Keymap/extra options (#1384)
Some checks are pending
Set up binary cache / cachix (default) (push) Waiting to run
Set up binary cache / cachix (maximal) (push) Waiting to run
Set up binary cache / cachix (nix) (push) Waiting to run
Treewide Checks / Validate flake (push) Waiting to run
Treewide Checks / Check formatting (push) Waiting to run
Treewide Checks / Check source tree for typos (push) Waiting to run
Treewide Checks / Validate documentation builds (push) Waiting to run
Treewide Checks / Validate documentation builds-1 (push) Waiting to run
Treewide Checks / Validate documentation builds-2 (push) Waiting to run
Treewide Checks / Validate documentation builds-3 (push) Waiting to run
Treewide Checks / Validate hyperlinks in documentation sources (push) Waiting to run
Treewide Checks / Validate Editorconfig conformance (push) Waiting to run
Build and deploy documentation / Check latest commit (push) Waiting to run
Build and deploy documentation / publish (push) Blocked by required conditions

* 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
This commit is contained in:
irobot 2026-02-03 06:52:39 -08:00 committed by GitHub
commit 92854bd0ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View file

@ -180,4 +180,9 @@ https://github.com/gorbit99/codewindow.nvim
- Add [codewindow.nvim] plugin in `vim.assistant.codewindow` with `enable` and - Add [codewindow.nvim] plugin in `vim.assistant.codewindow` with `enable` and
`setupOpts` `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 })`
<!-- vim: set textwidth=80: --> <!-- vim: set textwidth=80: -->

View file

@ -39,6 +39,7 @@ in {
getOpts = keymap: { getOpts = keymap: {
inherit (keymap) desc silent nowait script expr unique noremap; 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)})"; toLuaKeymap = bind: "vim.keymap.set(${toLuaObject bind.mode}, ${toLuaObject bind.key}, ${toLuaObject (getAction bind)}, ${toLuaObject (getOpts bind)})";