mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-22 13:20:44 +00:00
wrapper/rc: ignore user directories by default
This commit is contained in:
parent
be0fd17510
commit
fecf9f48be
1 changed files with 29 additions and 0 deletions
|
@ -24,6 +24,26 @@ in {
|
|||
take a look at the [{option}`official documentation`](https://neovim.io/doc/user/lua.html#vim.loader.enable()).
|
||||
'';
|
||||
|
||||
disableDefaultRuntimePaths = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
example = false;
|
||||
description = ''
|
||||
Disables the default runtime paths that are set by Neovim
|
||||
when it starts up. This is useful when you want to have
|
||||
full control over the runtime paths that are set by Neovim.
|
||||
|
||||
::: {.note}
|
||||
To avoid leaking imperative user configuration into your
|
||||
configuration, this is enabled by default. If you wish
|
||||
to load configuration from user configuration directories
|
||||
(e.g. `$HOME/.config/nvim`, `$HOME/.config/nvim/after`
|
||||
and `$HOME/.local/share/nvim/site`) you may set this
|
||||
option to true.
|
||||
:::
|
||||
'';
|
||||
};
|
||||
|
||||
additionalRuntimePaths = mkOption {
|
||||
type = listOf (either path str);
|
||||
default = [];
|
||||
|
@ -90,6 +110,15 @@ in {
|
|||
end
|
||||
''}
|
||||
|
||||
${optionalString cfg.disableDefaultRuntimePaths ''
|
||||
-- Remove default user runtime paths from the
|
||||
-- `runtimepath` option to avoid leaking user configuration
|
||||
-- into the final neovim wrapper
|
||||
vim.opt.runtimepath:remove(vim.fn.stdpath('config')) -- $HOME/.config/nvim
|
||||
vim.opt.runtimepath:remove(vim.fn.stdpath('config') .. "/after") -- $HOME/.config/nvim/after
|
||||
vim.opt.runtimepath:remove(vim.fn.stdpath('data') .. "/site") -- $HOME/.local/share/nvim/site
|
||||
''}
|
||||
|
||||
${optionalString cfg.enableLuaLoader "vim.loader.enable()"}
|
||||
'';
|
||||
|
||||
|
|
Loading…
Reference in a new issue