mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-12 18:24:35 +02:00
plugins/which-key: remove which-key logic from keymap module
This commit is contained in:
parent
dd6a114e52
commit
05b77732e3
3 changed files with 31 additions and 31 deletions
|
@ -280,32 +280,15 @@ in {
|
|||
(config.keymaps ++ modeMapsAsList);
|
||||
in
|
||||
optionalString (mappings != [])
|
||||
(
|
||||
if config.plugins.which-key.enable
|
||||
then ''
|
||||
-- Set up keybinds {{{
|
||||
do
|
||||
local __nixvim_binds = ${helpers.toLuaObject mappings}
|
||||
for i, map in ipairs(__nixvim_binds) do
|
||||
if not map.action then
|
||||
require("which-key").register({[map.key] = {name = map.options.desc }})
|
||||
else
|
||||
vim.keymap.set(map.mode, map.key, map.action, map.options)
|
||||
end
|
||||
end
|
||||
''
|
||||
-- Set up keybinds {{{
|
||||
do
|
||||
local __nixvim_binds = ${helpers.toLuaObject mappings}
|
||||
for i, map in ipairs(__nixvim_binds) do
|
||||
vim.keymap.set(map.mode, map.key, map.action, map.options)
|
||||
end
|
||||
-- }}}
|
||||
''
|
||||
else ''
|
||||
-- Set up keybinds {{{
|
||||
do
|
||||
local __nixvim_binds = ${helpers.toLuaObject mappings}
|
||||
for i, map in ipairs(__nixvim_binds) do
|
||||
vim.keymap.set(map.mode, map.key, map.action, map.options)
|
||||
end
|
||||
end
|
||||
-- }}}
|
||||
''
|
||||
);
|
||||
end
|
||||
-- }}}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue