From ba14b3538eaeab7f823c48feb06309eb09386ff4 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Sat, 30 Nov 2024 23:36:51 +0100 Subject: [PATCH 1/2] wrapper: use freeform types for vim.globals --- modules/wrapper/rc/options.nix | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/modules/wrapper/rc/options.nix b/modules/wrapper/rc/options.nix index 508a8bf8..df232572 100644 --- a/modules/wrapper/rc/options.nix +++ b/modules/wrapper/rc/options.nix @@ -5,7 +5,7 @@ }: let inherit (lib.options) mkOption mkEnableOption literalMD literalExpression; inherit (lib.strings) optionalString; - inherit (lib.types) str attrs lines listOf either path; + inherit (lib.types) str attrs lines listOf either path submodule anything; inherit (lib.nvim.types) dagOf; inherit (lib.nvim.lua) listToLuaTable; @@ -100,10 +100,21 @@ in { }; globals = mkOption { - type = attrs; - default = { - mapleader = " "; - maplocalleader = ","; + default = {}; + type = submodule { + freeformType = anything; + options = { + mapleader = mkOption { + type = str; + default = " "; + description = "The key used for mappings"; + }; + maplocalleader = mkOption { + type = str; + default = ","; + description = "The key used for mappings"; + }; + }; }; example = {"some_variable" = 42;}; description = '' From 3b6b6e7322b968bd38bffe3121fc318b3f44cc40 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Sat, 30 Nov 2024 23:37:16 +0100 Subject: [PATCH 2/2] docs: rename vim.leaderKey to vim.globals.mapleader --- modules/extra/deprecations.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/modules/extra/deprecations.nix b/modules/extra/deprecations.nix index 45dba827..2b6fa7d7 100644 --- a/modules/extra/deprecations.nix +++ b/modules/extra/deprecations.nix @@ -60,9 +60,6 @@ in { 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). - '') + (mkRenamedOptionModule ["vim" "leaderKey"] ["vim" "globals" "mapleader"]) ]; }