mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-02-04 19:05:55 +00:00
keymaps: fix unable to set noremap = false
Currently setting `vim.keymaps.*.noremap = false` has no effect. Given that noremap is set by default, the only way to undo it is to use `remap = true`. This commit adds `remap` as an internal option, and derives its final value as the inverse of noremap. This way, setting `noremap` to `false` now behaves as expected. See https://neovim.io/doc/user/lua-guide.html#_creating-mappings
This commit is contained in:
parent
7ec2619375
commit
e9d59f47e8
3 changed files with 16 additions and 4 deletions
|
|
@ -37,9 +37,11 @@ in {
|
|||
then mkLuaInline keymap.action
|
||||
else keymap.action;
|
||||
|
||||
getOpts = keymap: {
|
||||
inherit (keymap) desc silent nowait script expr unique noremap;
|
||||
};
|
||||
getOpts = keymap:
|
||||
{
|
||||
inherit (keymap) desc silent nowait script expr unique noremap;
|
||||
}
|
||||
// {remap = !keymap.noremap;};
|
||||
|
||||
toLuaKeymap = bind: "vim.keymap.set(${toLuaObject bind.mode}, ${toLuaObject bind.key}, ${toLuaObject (getAction bind)}, ${toLuaObject (getOpts bind)})";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue