From 71de14149dae25904362cc527d5f43ca1756319f Mon Sep 17 00:00:00 2001 From: diniamo Date: Sat, 30 Nov 2024 10:18:53 +0100 Subject: [PATCH] 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