From 71de14149dae25904362cc527d5f43ca1756319f Mon Sep 17 00:00:00 2001 From: diniamo Date: Sat, 30 Nov 2024 10:18:53 +0100 Subject: [PATCH 1/2] init/basic: deprecate `vim.leaderKey` in favour of `vim.globals.mapleader` and `vim.globals.maplocalleader` tmp Co-authored-by: raf --- modules/extra/deprecations.nix | 5 +++++ modules/neovim/init/basic.nix | 8 -------- modules/wrapper/rc/options.nix | 5 ++++- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/extra/deprecations.nix b/modules/extra/deprecations.nix index a4ac56a3..45dba827 100644 --- a/modules/extra/deprecations.nix +++ b/modules/extra/deprecations.nix @@ -59,5 +59,10 @@ in { With Trouble having so many different modes, and breaking changes upstream, it no longer makes sense, nor works, to toggle only Trouble. '') + # 2024-11-30 + (mkRemovedOptionModule ["vim" "leaderKey"] '' + This has been deprecated in favor of using the more generic `vim.globals` + (you can use `vim.globals.mapleader` to change this instead). + '') ]; } diff --git a/modules/neovim/init/basic.nix b/modules/neovim/init/basic.nix index 2114dcb8..c7d98e02 100644 --- a/modules/neovim/init/basic.nix +++ b/modules/neovim/init/basic.nix @@ -14,12 +14,6 @@ cfg = config.vim; in { options.vim = { - leaderKey = mkOption { - type = str; - default = " "; - description = "The leader key used for `` mappings"; - }; - colourTerm = mkOption { type = bool; default = true; @@ -197,8 +191,6 @@ in { vim.o.tm = ${toLuaObject cfg.mapTimeout} vim.o.cursorlineopt = ${toLuaObject cfg.cursorlineOpt} vim.o.scrolloff = ${toLuaObject cfg.scrollOffset} - vim.g.mapleader = ${toLuaObject cfg.leaderKey} - vim.g.maplocalleader = ${toLuaObject cfg.leaderKey} ${optionalString cfg.undoFile.enable '' vim.o.undofile = true diff --git a/modules/wrapper/rc/options.nix b/modules/wrapper/rc/options.nix index 1159b9fe..c76c000b 100644 --- a/modules/wrapper/rc/options.nix +++ b/modules/wrapper/rc/options.nix @@ -101,7 +101,10 @@ in { globals = mkOption { type = attrs; - default = {}; + default = { + mapleader = " "; + maplocalleader = ","; + }; example = {"some_variable" = 42;}; description = '' An attribute set containing global variable values From 8bc230bf0071879c0df37a075c2c907a5b15685d Mon Sep 17 00:00:00 2001 From: diniamo Date: Sat, 30 Nov 2024 10:19:31 +0100 Subject: [PATCH 2/2] docs(0.7): add breaking changes entry --- docs/release-notes/rl-0.7.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/rl-0.7.md b/docs/release-notes/rl-0.7.md index 3f24ae8f..00ebcea5 100644 --- a/docs/release-notes/rl-0.7.md +++ b/docs/release-notes/rl-0.7.md @@ -81,6 +81,16 @@ favor of nixfmt (more information can be found To migrate to `nixfmt`, simply change `vim.languages.nix.format.type` to `nixfmt`. +### leader changes {#sec-leader-changes} + +This has been deprecated in favor of using the more generic `vim.globals` (you +can use `vim.globals.mapleader` to change this instead). + +Rust specific keymaps now use `maplocalleader` instead of `localleader` by +default. This is to avoid conflicts with other modules. You can change +`maplocalleader` with `vim.globals.maplocalleader`, but it's recommended to set +it to something other than `mapleader` to avoid conflicts. + ## Changelog {#sec-release-0.7-changelog} [ItsSorae](https://github.com/ItsSorae): @@ -201,7 +211,8 @@ To migrate to `nixfmt`, simply change `vim.languages.nix.format.type` to is bundled with nvf, if you enable the module, since there is no way to provide only the LSP server. -- Add [`run.nvim`](https://github.com/diniamo/run.nvim) support for running code using cached commands. +- Add [`run.nvim`](https://github.com/diniamo/run.nvim) support for running code + using cached commands. [Neovim documentation on `vim.cmd`]: https://neovim.io/doc/user/lua.html#vim.cmd()