From 92854bd0eaaa06914afba345741c372439b8e335 Mon Sep 17 00:00:00 2001 From: irobot Date: Tue, 3 Feb 2026 06:52:39 -0800 Subject: [PATCH] Keymap/extra options (#1384) * 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 * keymaps/config: fix formatting merge unnecessarily split attrset * keymaps/options: remove unnecessary option + tweak related release notes entry --- docs/manual/release-notes/rl-0.9.md | 5 +++++ modules/wrapper/rc/config.nix | 1 + 2 files changed, 6 insertions(+) diff --git a/docs/manual/release-notes/rl-0.9.md b/docs/manual/release-notes/rl-0.9.md index 735ef61d..651f9f4e 100644 --- a/docs/manual/release-notes/rl-0.9.md +++ b/docs/manual/release-notes/rl-0.9.md @@ -180,4 +180,9 @@ https://github.com/gorbit99/codewindow.nvim - Add [codewindow.nvim] plugin in `vim.assistant.codewindow` with `enable` and `setupOpts` +[irobot](https://github.com/irobot): + +- Fix non-functional `vim.keymaps.*.noremap`. Now, setting it to false is + equivalent to `:lua vim.keymap.set(..., { remap = true })` + diff --git a/modules/wrapper/rc/config.nix b/modules/wrapper/rc/config.nix index 77a62d58..50211d2e 100644 --- a/modules/wrapper/rc/config.nix +++ b/modules/wrapper/rc/config.nix @@ -39,6 +39,7 @@ in { 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)})";