feat(client): add per-subgroup Vim mapping opt-out globals
CI / cargo fmt --check (push) Successful in 40s
CI / cargo clippy (push) Failing after 38s
CI / cargo test (push) Successful in 38s
CI / editor keymaps (push) Successful in 1m30s

The plain-Vim ftplugin only exposed a whole-layer
g:nuwiki_no_default_mappings gate, so Vim users could not drop a single
keymap group the way Neovim users can via mappings.<group> = false. Add
g:nuwiki_no_{wiki_prefix,links,lists,headers,table_editing,diary,
html_export,text_objects}_mappings, each wrapping its group block, to
reach parity with lua/nuwiki/keymaps.lua. Cover them with a dedicated
opt-out harness and document them in the README and help file.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-30 23:40:29 -03:00
parent 3a33d53c22
commit e9243f743e
5 changed files with 269 additions and 103 deletions
+27 -2
View File
@@ -207,6 +207,28 @@ Vim-specific globals ~
When 1, the Vim path skips every buffer-local keymap. Equivalent to
`mappings.enabled = false` in Neovim.
*g:nuwiki_no_wiki_prefix_mappings*
*g:nuwiki_no_links_mappings*
*g:nuwiki_no_lists_mappings*
*g:nuwiki_no_headers_mappings*
*g:nuwiki_no_table_editing_mappings*
*g:nuwiki_no_diary_mappings*
*g:nuwiki_no_html_export_mappings*
*g:nuwiki_no_text_objects_mappings*
`g:nuwiki_no_<group>_mappings` 0
Per-subgroup opt-outs, each defaulting to 0. Setting one to 1 drops just
that group's buffer-local keymaps while leaving the rest in place; the
whole-layer |g:nuwiki_no_default_mappings| still wins over all of them.
These mirror the Lua-side `mappings.<group>` booleans. Valid groups:
`wiki_prefix` `<Leader>w*`
`links` `<CR>`, `<S-CR>`, `<Tab>`, `<BS>`, `+`, …
`lists` `<C-Space>`, `gl*`, `o`/`O`, insert-mode list edits
`headers` `=`, `-`, `]]`, `[[`, `]=`, `[=`, `]u`, `[u`
`table_editing` `gqq`, `<A-Left>`, `<A-Right>`, insert `<Tab>`
`diary` `<C-Down>`, `<C-Up>`
`html_export` `<Leader>wh`, `<Leader>whh`, `<Leader>wha`
`text_objects` `ah`, `ih`, `al`, `il`, `a\`, `i\`, `ac`, `ic`
*g:nuwiki_no_folding*
`g:nuwiki_no_folding` 0
When 1, the Vim path skips `foldexpr` / `foldmethod` setup.
@@ -378,8 +400,11 @@ Other ~
==============================================================================
6. KEYMAPS *nuwiki-keymaps*
Every keymap is buffer-local. Disable a group via `mappings.<group> =
false` in Neovim, or `let g:nuwiki_no_default_mappings = 1` in Vim.
Every keymap is buffer-local. Disable the whole layer via
`mappings.enabled = false` in Neovim, or `let g:nuwiki_no_default_mappings
= 1` in Vim. Drop a single group via `mappings.<group> = false` in Neovim,
or `let g:nuwiki_no_<group>_mappings = 1` in Vim (see
|g:nuwiki_no_links_mappings| for the group list).
Links (normal mode) ~