Compare commits

...

8 commits

Author SHA1 Message Date
DamitusThyYeetus123
196a4603ca
Merge bd9fe9eb68 into a0a57757a0 2024-12-15 01:16:38 +01:00
a0a57757a0
wrapper/rc: explicitly add tabstop & shiftwidth to vim.options
Defaults are taken from Neovim's :help tags for those options to avoid intrusive/confusing behaviour.
2024-12-12 20:16:27 +03:00
raf
bd9fe9eb68
Merge branch 'main' into v0.7 2024-12-06 15:57:58 +03:00
raf
5b2ab22777
Merge branch 'main' into v0.7 2024-12-04 17:48:44 +03:00
damii
6d07646fae Fix formatting 2024-12-04 09:35:25 +11:00
Ching Pei Yang
14de965ce9
formatting 2024-12-03 01:31:48 +01:00
DamitusThyYeetus123
234ad31909
Merge branch 'NotAShelf:v0.7' into v0.7 2024-12-03 09:13:34 +11:00
DamitusThyYeetus123
73cc5edd31 nvim-tree: Add directory opening 2024-11-12 13:25:08 +11:00
2 changed files with 40 additions and 17 deletions

View file

@ -77,6 +77,9 @@ in {
-- buffer is a real file on the disk
local real_file = vim.fn.filereadable(data.file) == 1
-- buffer is a directory
local directory = vim.fn.isdirectory(data.file) == 1
-- buffer is a [No Name]
local no_name = data.file == "" and vim.bo[data.buf].buftype == ""
@ -84,7 +87,7 @@ in {
local filetype = vim.bo[data.buf].ft
-- only files please
if not real_file and not no_name then
if not real_file and not directory and not no_name then
return
end
@ -93,6 +96,10 @@ in {
return
end
-- cd if buffer is a directory
if directory then
vim.cmd.cd(data.file)
end
-- open the tree but don't focus it
require("nvim-tree.api").tree.toggle({ focus = false })
end

View file

@ -126,16 +126,14 @@ in {
example = {"some_variable" = 42;};
description = ''
An attribute set containing global variable values
for storing vim variables as early as possible. If
populated, this option will set vim variables in the
built luaConfigRC as the first item.
A freeform attribute set containing global variable values for setting vim
variables as early as possible. If populated, this option will set vim variables
in the built {option}`luaConfigRC` as the first item.
::: {.note}
`{foo = "bar";}` will set `vim.g.foo` to "bar", where
the type of `bar` in the resulting Lua value will be
inferred from the type of the value in the `{name = value;}`
pair passed to the option.
`{foo = "bar";}` will set `vim.g.foo` to "bar", where the type of `bar` in the
resulting Lua value will be inferred from the type of the value in the
`{name = value;}` pair passed to the option.
:::
'';
};
@ -212,21 +210,39 @@ in {
default = true;
description = "Enable word wrapping.";
};
tabstop = mkOption {
type = int;
default = 8; # Neovim default
description = ''
Number of spaces that a `<Tab>` in the file counts for. Also see
the {command}`:retab` command, and the {option}`softtabstop` option.
'';
};
shiftwidth = mkOption {
type = int;
default = 8; # Neovim default
description = ''
Number of spaces to use for each step of (auto)indent. Used for
{option}`cindent`, `>>`, `<<`, etc.
When zero the {option}`tabstop` value will be used.
'';
};
};
};
example = {visualbell = true;};
description = ''
An attribute set containing vim options to be set
as early as possible. If populated, this option will
set vim options in the built luaConfigRC after `basic`
and before `pluginConfigs` DAG entries.
A freeform attribute set containing vim options to be set as early as possible.
If populated, this option will set vim options in the built {option}`luaConfigRC`
after `basic` and before `pluginConfigs` DAG entries.
::: {.note}
`{foo = "bar";}` will set `vim.o.foo` to "bar", where
the type of `bar` in the resulting Lua value will be
inferred from the type of the value in the`{name = value;}`
pair passed to the option.
`{foo = "bar";}` will set `vim.o.foo` to "bar", where the type of `bar` in the
resulting Lua value will be inferred from the type of the value in the
`{name = value;}` pair passed to the option.
:::
'';
};