diff --git a/docs/release-notes/rl-0.7.md b/docs/release-notes/rl-0.7.md index de0033db..f8cec50f 100644 --- a/docs/release-notes/rl-0.7.md +++ b/docs/release-notes/rl-0.7.md @@ -93,6 +93,9 @@ everyone. - Add dap-go for better dap configurations - Make noice.nvim customizable - Standardize border style options and add custom borders +- Remove `vim.disableDefaultRuntimePaths` in wrapper options. + - As nvf uses `$NVIM_APP_NAME` as of recent changes, we can safely assume any + configuration in `$XDG_CONFIG_HOME/nvf` is intentional. [rust-tools.nvim]: https://github.com/simrat39/rust-tools.nvim [rustaceanvim]: https://github.com/mrcjkb/rustaceanvim @@ -270,4 +273,5 @@ everyone. [ksonj](https://github.com/ksonj): -- Add LSP support for Scala via [nvim-metals](https://github.com/scalameta/nvim-metals) +- Add LSP support for Scala via + [nvim-metals](https://github.com/scalameta/nvim-metals) diff --git a/modules/extra/deprecations.nix b/modules/extra/deprecations.nix index c4ff4d30..779a7527 100644 --- a/modules/extra/deprecations.nix +++ b/modules/extra/deprecations.nix @@ -35,5 +35,19 @@ in { vim.snippets.vsnip.enable has been removed in favor of the more modern luasnip. '') (mkRenamedOptionModule ["vim" "lsp" "lspkind" "mode"] ["vim" "lsp" "lspkind" "setupOpts" "mode"]) + + # 2024-10-14 + (mkRemovedOptionModule ["vim" "configRC"] '' + Please migrate your configRC sections to Neovim's Lua format, and + add them to `vim.luaConfigRC`. + + See the v0.7 release notes for more information on why and how to + migrate your existing configurations to the new format. + '') + + (mkRemovedOptionModule ["vim" "disableDefaultRuntimePaths"] '' + Nvf now uses $NVIM_APP_NAME so there is no longer the problem of + (accidental) leaking of user configuration. + '') ]; } diff --git a/modules/wrapper/rc/options.nix b/modules/wrapper/rc/options.nix index 70ab2a8a..1159b9fe 100644 --- a/modules/wrapper/rc/options.nix +++ b/modules/wrapper/rc/options.nix @@ -3,27 +3,18 @@ lib, ... }: let - inherit (lib.modules) mkRemovedOptionModule; inherit (lib.options) mkOption mkEnableOption literalMD literalExpression; inherit (lib.strings) optionalString; - inherit (lib.types) str attrs lines listOf either path bool; + inherit (lib.types) str attrs lines listOf either path; inherit (lib.nvim.types) dagOf; inherit (lib.nvim.lua) listToLuaTable; cfg = config.vim; in { - imports = [ - (mkRemovedOptionModule ["vim" "configRC"] '' - Please migrate your configRC sections to Neovim's Lua format, and - add them to luaConfigRC. - - See the v0.7 release notes for more information on how to migrate - your existing configurations. - '') - ]; - options.vim = { enableLuaLoader = mkEnableOption '' + [{option}`official documentation`]: https://neovim.io/doc/user/lua.html#vim.loader.enable() + the experimental Lua module loader to speed up the start up process If `true`, this will enable the experimental Lua module loader which: @@ -32,30 +23,12 @@ in { - adds the libs loader - removes the default Neovim loader + ::: {.note} This is disabled by default. Before setting this option, please - take a look at the [{option}`official documentation`](https://neovim.io/doc/user/lua.html#vim.loader.enable()). + take a look at the [{option}`official documentation`]. + ::: ''; - 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. {file}`$HOME/.config/nvim`, {file}`$HOME/.config/nvim/after` - and {file}`$HOME/.local/share/nvim/site`) you may set this - option to true. - ::: - ''; - }; - additionalRuntimePaths = mkOption { type = listOf (either path str); default = []; @@ -180,21 +153,6 @@ in { vim.opt.runtimepath:append(${listToLuaTable cfg.additionalRuntimePaths}) ''} - ${optionalString cfg.disableDefaultRuntimePaths '' - -- Remove default user runtime paths from the - -- `runtimepath` option to avoid leaking user configuration - -- into the final neovim wrapper - local defaultRuntimePaths = { - vim.fn.stdpath('config'), -- $HOME/.config/nvim - vim.fn.stdpath('config') .. "/after", -- $HOME/.config/nvim/after - vim.fn.stdpath('data') .. "/site", -- $HOME/.local/share/nvim/site - } - - for _, path in ipairs(defaultRuntimePaths) do - vim.opt.runtimepath:remove(path) - end - ''} - ${optionalString cfg.enableLuaLoader "vim.loader.enable()"} '';