Compare commits

...

2 commits

Author SHA1 Message Date
Ching Pei Yang
3b6b6e7322
docs: rename vim.leaderKey to vim.globals.mapleader
Some checks are pending
Check for typos in the source tree / check-typos (push) Waiting to run
2024-11-30 23:37:16 +01:00
Ching Pei Yang
ba14b3538e
wrapper: use freeform types for vim.globals 2024-11-30 23:36:51 +01:00
2 changed files with 17 additions and 9 deletions

View file

@ -60,9 +60,6 @@ in {
upstream, it no longer makes sense, nor works, to toggle only Trouble. upstream, it no longer makes sense, nor works, to toggle only Trouble.
'') '')
# 2024-11-30 # 2024-11-30
(mkRemovedOptionModule ["vim" "leaderKey"] '' (mkRenamedOptionModule ["vim" "leaderKey"] ["vim" "globals" "mapleader"])
This has been deprecated in favor of using the more generic `vim.globals`
(you can use `vim.globals.mapleader` to change this instead).
'')
]; ];
} }

View file

@ -5,7 +5,7 @@
}: let }: let
inherit (lib.options) mkOption mkEnableOption literalMD literalExpression; inherit (lib.options) mkOption mkEnableOption literalMD literalExpression;
inherit (lib.strings) optionalString; 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.types) dagOf;
inherit (lib.nvim.lua) listToLuaTable; inherit (lib.nvim.lua) listToLuaTable;
@ -100,10 +100,21 @@ in {
}; };
globals = mkOption { globals = mkOption {
type = attrs; default = {};
default = { type = submodule {
mapleader = " "; freeformType = anything;
maplocalleader = ","; options = {
mapleader = mkOption {
type = str;
default = " ";
description = "The key used for <leader> mappings";
};
maplocalleader = mkOption {
type = str;
default = ",";
description = "The key used for <localleader> mappings";
};
};
}; };
example = {"some_variable" = 42;}; example = {"some_variable" = 42;};
description = '' description = ''