feat(client): add per-subgroup Vim mapping opt-out globals
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:
@@ -257,6 +257,8 @@ let g:nuwiki_link_severity = 'warn' " 'off'|'hint'|'warn'|'error'
|
||||
let g:nuwiki_no_default_mappings = 0 " set to 1 to skip the keymap layer
|
||||
let g:nuwiki_no_folding = 0 " set to 1 to skip foldexpr setup
|
||||
let g:nuwiki_mouse_mappings = 0 " set to 1 to enable mouse maps
|
||||
" Drop individual keymap subgroups (mirror the Lua `mappings.<group>` toggles):
|
||||
" g:nuwiki_no_{wiki_prefix,links,lists,headers,table_editing,diary,html_export,text_objects}_mappings
|
||||
```
|
||||
|
||||
### Reference
|
||||
@@ -337,7 +339,15 @@ For users configuring without Lua.
|
||||
| `g:nuwiki_file_extension` | `'.wiki'` | wiki file extension |
|
||||
| `g:nuwiki_log_level` | `'warn'` | `error` \| `warn` \| `info` \| `debug` |
|
||||
| `g:nuwiki_link_severity` | `'warn'` | broken-link severity: `off` \| `hint` \| `warn` \| `error` |
|
||||
| `g:nuwiki_no_default_mappings` | `0` | `1` skips the keymap layer |
|
||||
| `g:nuwiki_no_default_mappings` | `0` | `1` skips the whole keymap layer |
|
||||
| `g:nuwiki_no_wiki_prefix_mappings` | `0` | `1` skips the `<Leader>w*` group |
|
||||
| `g:nuwiki_no_links_mappings` | `0` | `1` skips the link group (`<CR>`, `+`, …) |
|
||||
| `g:nuwiki_no_lists_mappings` | `0` | `1` skips the list group (`<C-Space>`, `gl*`, `o`/`O`, …) |
|
||||
| `g:nuwiki_no_headers_mappings` | `0` | `1` skips the header group (`=`, `-`, `]]`, …) |
|
||||
| `g:nuwiki_no_table_editing_mappings` | `0` | `1` skips the table group (`gqq`, `<A-Left>`, insert `<Tab>`) |
|
||||
| `g:nuwiki_no_diary_mappings` | `0` | `1` skips the diary nav group (`<C-Down>`, `<C-Up>`) |
|
||||
| `g:nuwiki_no_html_export_mappings` | `0` | `1` skips the HTML export group (`<Leader>wh*`) |
|
||||
| `g:nuwiki_no_text_objects_mappings` | `0` | `1` skips the text-object group (`ah`, `il`, …) |
|
||||
| `g:nuwiki_no_folding` | `0` | `1` skips foldexpr setup |
|
||||
| `g:nuwiki_mouse_mappings` | `0` | `1` enables mouse maps |
|
||||
|
||||
@@ -443,8 +453,10 @@ instead.
|
||||
|
||||
### Default keymaps
|
||||
|
||||
All buffer-local. Disable any group via `mappings.<group> = false` in
|
||||
Neovim, or `let g:nuwiki_no_default_mappings = 1` in Vim.
|
||||
All 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.
|
||||
|
||||
**Links** (normal mode)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user