mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
keymaps: switch to lua API vim.keymap.set (#115)
* modules/keymaps: switch to lua API vim.keymap.set * add test for keymaps Co-authored-by: Pedro Alves <pta2002@pta2002.com>
This commit is contained in:
parent
9aec0f9275
commit
5c6ba55f8a
2 changed files with 5 additions and 2 deletions
|
@ -117,14 +117,13 @@ in
|
||||||
(helpers.genMaps "c" config.maps.command);
|
(helpers.genMaps "c" config.maps.command);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
# TODO: Use vim.keymap.set if on nvim >= 0.7
|
|
||||||
extraConfigLua = optionalString (mappings != [ ]) ''
|
extraConfigLua = optionalString (mappings != [ ]) ''
|
||||||
-- Set up keybinds {{{
|
-- Set up keybinds {{{
|
||||||
do
|
do
|
||||||
local __nixvim_binds = ${helpers.toLuaObject mappings}
|
local __nixvim_binds = ${helpers.toLuaObject mappings}
|
||||||
|
|
||||||
for i, map in ipairs(__nixvim_binds) do
|
for i, map in ipairs(__nixvim_binds) do
|
||||||
vim.api.nvim_set_keymap(map.mode, map.key, map.action, map.config)
|
vim.keymap.set(map.mode, map.key, map.action, map.config)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- }}}
|
-- }}}
|
||||||
|
|
|
@ -81,6 +81,10 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
keymaps = build {
|
||||||
|
maps.normal."," = "<cmd>echo \"test\"<cr>";
|
||||||
|
};
|
||||||
|
|
||||||
issue-40 = build-stable {
|
issue-40 = build-stable {
|
||||||
plugins = {
|
plugins = {
|
||||||
nix.enable = true;
|
nix.enable = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue