fix(commands)+docs: even out :NuwikiUISelect; exhaustive subgroup key lists
- ftplugin/vimwiki.vim: add buffer-local :NuwikiUISelect to the Vim path (it previously existed only on the Neovim path, contradicting the docs' "buffer-local on every .wiki buffer" claim — a global fallback masked it). Now symmetric with :VimwikiUISelect. - Make every keymap subgroup description list all of its bindings instead of trailing with "…": the README mappings-subgroups table, the README config-example comments, the README g:nuwiki_no_<group>_mappings rows, the doc/nuwiki.txt group→keys list, and the lua/nuwiki/config.lua comment. Also fixes the doc list that had dropped aH/iH from text_objects and adds the mouse group. Each notes that the <Leader>w prefix follows map_prefix. helptags validates (no dup tags); all keymap suites pass (266+18+21 Vim, 275 Lua); :NuwikiUISelect confirmed defined on a Vim .wiki buffer. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -251,15 +251,15 @@ require('nuwiki').setup({
|
|||||||
-- Keymap groups. Flip subgroups off independently. Defaults all on.
|
-- Keymap groups. Flip subgroups off independently. Defaults all on.
|
||||||
mappings = {
|
mappings = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
wiki_prefix = true, -- <Leader>w*
|
wiki_prefix = true, -- <Leader>w{w,t,s,i}, <Leader>w<Leader>{w,y,t,m,i}
|
||||||
links = true, -- <CR>, <S-CR>, <Tab>, <BS>, +, …
|
links = true, -- <CR>, <S-CR>, <C-CR>, <C-S-CR>, <D-CR>, <M-CR>, <BS>, <Tab>, <S-Tab>, + (n/x), <Leader>w{n,d,r}, <Leader>wc (n/x)
|
||||||
lists = true, -- <C-Space>, gln/glp/glx, gl/gL, o/O, …
|
lists = true, -- <C-Space>, gnt, gln, glp, glx, glh, gll, gLh, gLl, glr, gLr, gl{-,*,#,1,i,I,a,A}, gL{…}, gl, gL, o, O; insert <C-D>, <C-T>, <C-L><C-J/K/M>, <CR>
|
||||||
headers = true, -- =, -, ]], [[, ]=, [=, ]u, [u
|
headers = true, -- =, -, ]], [[, ]=, [=, ]u, [u
|
||||||
table_editing = true, -- gqq, <A-Left>, <A-Right>, <Tab> in insert mode
|
table_editing = true, -- gqq, gq1, gww, gw1, <A-Left>, <A-Right>; insert <Tab>, <S-Tab>
|
||||||
diary = true, -- <C-Down>, <C-Up>
|
diary = true, -- <C-Down>, <C-Up>
|
||||||
html_export = true, -- <Leader>wh, <Leader>whh
|
html_export = true, -- <Leader>wh, <Leader>whh, <Leader>wha
|
||||||
text_objects = true, -- ah, ih, aH, iH, al, il, a\, i\, ac, ic
|
text_objects = true, -- ah, ih, aH, iH, al, il, a\, i\, ac, ic
|
||||||
mouse = false, -- <2-LeftMouse>, <RightMouse>, … (opt-in)
|
mouse = false, -- <2-LeftMouse>, <S-2-LeftMouse>, <C-2-LeftMouse>, <MiddleMouse>, <RightMouse> (opt-in)
|
||||||
},
|
},
|
||||||
|
|
||||||
-- 'lsp' (server-driven foldingRange, default) | 'expr' (regex) | 'off'.
|
-- 'lsp' (server-driven foldingRange, default) | 'expr' (regex) | 'off'.
|
||||||
@@ -308,18 +308,20 @@ let g:nuwiki_mouse_mappings = 0 " set to 1 to enable mouse maps
|
|||||||
|
|
||||||
Each is a boolean. All default to `true` except `mouse`.
|
Each is a boolean. All default to `true` except `mouse`.
|
||||||
|
|
||||||
| Key | Default | Controls |
|
The `<Leader>w` prefix in the `wiki_prefix`, `links`, and `html_export` rows is the default `map_prefix` and moves with it.
|
||||||
|
|
||||||
|
| Key | Default | Controls (every binding in the group) |
|
||||||
|-----|---------|----------|
|
|-----|---------|----------|
|
||||||
| `enabled` | `true` | master switch for the whole keymap layer |
|
| `enabled` | `true` | master switch for the whole keymap layer |
|
||||||
| `wiki_prefix` | `true` | `<Leader>w*` |
|
| `wiki_prefix` | `true` | `<Leader>ww`, `<Leader>wt`, `<Leader>ws`, `<Leader>wi`, `<Leader>w<Leader>w`, `<Leader>w<Leader>y`, `<Leader>w<Leader>t`, `<Leader>w<Leader>m`, `<Leader>w<Leader>i` |
|
||||||
| `links` | `true` | `<CR>`, `<S-CR>`, `<Tab>`, `<BS>`, `+`, … |
|
| `links` | `true` | `<CR>`, `<S-CR>`, `<C-CR>`, `<C-S-CR>`, `<D-CR>`, `<M-CR>`, `<BS>`, `<Tab>`, `<S-Tab>`, `+` (normal + visual), `<Leader>wn`, `<Leader>wd`, `<Leader>wr`, `<Leader>wc` (normal + visual) |
|
||||||
| `lists` | `true` | `<C-Space>`, `gln`/`glp`/`glx`, `gl`/`gL`, `o`/`O`, … |
|
| `lists` | `true` | `<C-Space>` (also `<C-@>`/`<Nul>`), `gnt`, `gln`, `glp`, `glx`, `glh`, `gll`, `gLh`, `gLl`, `glr`, `gLr`, `gl-`, `gl*`, `gl#`, `gl1`, `gli`, `glI`, `gla`, `glA`, `gL-`, `gL*`, `gL#`, `gL1`, `gLi`, `gLI`, `gLa`, `gLA`, `gl`, `gL`, `o`, `O`; insert: `<C-D>`, `<C-T>`, `<C-L><C-J>`, `<C-L><C-K>`, `<C-L><C-M>`, `<CR>` |
|
||||||
| `headers` | `true` | `=`, `-`, `]]`, `[[`, `]=`, `[=`, `]u`, `[u` |
|
| `headers` | `true` | `=`, `-`, `]]`, `[[`, `]=`, `[=`, `]u`, `[u` |
|
||||||
| `table_editing` | `true` | `gqq`, `<A-Left>`, `<A-Right>`, `<Tab>` (insert) |
|
| `table_editing` | `true` | `gqq`, `gq1`, `gww`, `gw1`, `<A-Left>`, `<A-Right>`; insert: `<Tab>`, `<S-Tab>` |
|
||||||
| `diary` | `true` | `<C-Down>`, `<C-Up>` |
|
| `diary` | `true` | `<C-Down>`, `<C-Up>` |
|
||||||
| `html_export` | `true` | `<Leader>wh`, `<Leader>whh` |
|
| `html_export` | `true` | `<Leader>wh`, `<Leader>whh`, `<Leader>wha` |
|
||||||
| `text_objects` | `true` | `ah`, `ih`, `aH`, `iH`, `al`, `il`, `a\`, `i\`, `ac`, `ic` |
|
| `text_objects` | `true` | `ah`, `ih`, `aH`, `iH`, `al`, `il`, `a\`, `i\`, `ac`, `ic` |
|
||||||
| `mouse` | `false` | `<2-LeftMouse>`, `<RightMouse>`, … (opt-in) |
|
| `mouse` | `false` | `<2-LeftMouse>`, `<S-2-LeftMouse>`, `<C-2-LeftMouse>`, `<MiddleMouse>`, `<RightMouse>` (opt-in) |
|
||||||
|
|
||||||
#### Per-wiki keys (`wikis[]`)
|
#### Per-wiki keys (`wikis[]`)
|
||||||
|
|
||||||
@@ -384,14 +386,14 @@ For users configuring without Lua.
|
|||||||
| `g:nuwiki_link_severity` | `'warn'` | broken-link severity: `off` \| `hint` \| `warn` \| `error` |
|
| `g:nuwiki_link_severity` | `'warn'` | broken-link severity: `off` \| `hint` \| `warn` \| `error` |
|
||||||
| `g:nuwiki_map_prefix` | `'<Leader>w'` | prefix for the wiki command family |
|
| `g:nuwiki_map_prefix` | `'<Leader>w'` | prefix for the wiki command family |
|
||||||
| `g:nuwiki_no_default_mappings` | `0` | `1` skips the whole 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_wiki_prefix_mappings` | `0` | `1` skips the `wiki_prefix` group (`<Leader>ww`, `<Leader>wt`, `<Leader>ws`, `<Leader>wi`, `<Leader>w<Leader>{w,y,t,m,i}`) |
|
||||||
| `g:nuwiki_no_links_mappings` | `0` | `1` skips the link group (`<CR>`, `+`, …) |
|
| `g:nuwiki_no_links_mappings` | `0` | `1` skips the `links` group (`<CR>`, `<S-CR>`, `<C-CR>`, `<C-S-CR>`, `<D-CR>`, `<M-CR>`, `<BS>`, `<Tab>`, `<S-Tab>`, `+`, `<Leader>w{n,d,r,c}`) |
|
||||||
| `g:nuwiki_no_lists_mappings` | `0` | `1` skips the list group (`<C-Space>`, `gl*`, `o`/`O`, …) |
|
| `g:nuwiki_no_lists_mappings` | `0` | `1` skips the `lists` group (`<C-Space>`, `gnt`, `gln`, `glp`, `glx`, `glh`, `gll`, `gLh`, `gLl`, `glr`, `gLr`, `gl{-,*,#,1,i,I,a,A}`, `gL{…}`, `gl`, `gL`, `o`, `O`; insert `<C-D>`, `<C-T>`, `<C-L><C-J/K/M>`, `<CR>`) |
|
||||||
| `g:nuwiki_no_headers_mappings` | `0` | `1` skips the header group (`=`, `-`, `]]`, …) |
|
| `g:nuwiki_no_headers_mappings` | `0` | `1` skips the `headers` group (`=`, `-`, `]]`, `[[`, `]=`, `[=`, `]u`, `[u`) |
|
||||||
| `g:nuwiki_no_table_editing_mappings` | `0` | `1` skips the table group (`gqq`, `<A-Left>`, insert `<Tab>`) |
|
| `g:nuwiki_no_table_editing_mappings` | `0` | `1` skips the `table_editing` group (`gqq`, `gq1`, `gww`, `gw1`, `<A-Left>`, `<A-Right>`; insert `<Tab>`, `<S-Tab>`) |
|
||||||
| `g:nuwiki_no_diary_mappings` | `0` | `1` skips the diary nav group (`<C-Down>`, `<C-Up>`) |
|
| `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_html_export_mappings` | `0` | `1` skips the `html_export` group (`<Leader>wh`, `<Leader>whh`, `<Leader>wha`) |
|
||||||
| `g:nuwiki_no_text_objects_mappings` | `0` | `1` skips the text-object group (`ah`, `il`, …) |
|
| `g:nuwiki_no_text_objects_mappings` | `0` | `1` skips the `text_objects` group (`ah`, `ih`, `aH`, `iH`, `al`, `il`, `a\`, `i\`, `ac`, `ic`) |
|
||||||
| `g:nuwiki_no_folding` | `0` | `1` skips foldexpr setup |
|
| `g:nuwiki_no_folding` | `0` | `1` skips foldexpr setup |
|
||||||
| `g:nuwiki_mouse_mappings` | `0` | `1` enables mouse maps |
|
| `g:nuwiki_mouse_mappings` | `0` | `1` enables mouse maps |
|
||||||
| `g:nuwiki_binary_path` | _(auto)_ | path to a prebuilt `nuwiki-ls` binary, bypassing the bundled one |
|
| `g:nuwiki_binary_path` | _(auto)_ | path to a prebuilt `nuwiki-ls` binary, bypassing the bundled one |
|
||||||
|
|||||||
+23
-6
@@ -267,15 +267,32 @@ Vim-specific globals ~
|
|||||||
Per-subgroup opt-outs, each defaulting to 0. Setting one to 1 drops just
|
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
|
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.
|
whole-layer |g:nuwiki_no_default_mappings| still wins over all of them.
|
||||||
These mirror the Lua-side `mappings.<group>` booleans. Valid groups:
|
These mirror the Lua-side `mappings.<group>` booleans. Every binding in
|
||||||
`wiki_prefix` `<Leader>w*`
|
each group (the `<Leader>w` prefix follows |g:nuwiki_map_prefix|):
|
||||||
`links` `<CR>`, `<S-CR>`, `<Tab>`, `<BS>`, `+`, …
|
`wiki_prefix` `<Leader>ww`, `<Leader>wt`, `<Leader>ws`,
|
||||||
`lists` `<C-Space>`, `gl*`, `o`/`O`, insert-mode list edits
|
`<Leader>wi`, `<Leader>w<Leader>w`,
|
||||||
|
`<Leader>w<Leader>y`, `<Leader>w<Leader>t`,
|
||||||
|
`<Leader>w<Leader>m`, `<Leader>w<Leader>i`
|
||||||
|
`links` `<CR>`, `<S-CR>`, `<C-CR>`, `<C-S-CR>`, `<D-CR>`,
|
||||||
|
`<M-CR>`, `<BS>`, `<Tab>`, `<S-Tab>`, `+` (n/x),
|
||||||
|
`<Leader>wn`, `<Leader>wd`, `<Leader>wr`,
|
||||||
|
`<Leader>wc` (n/x)
|
||||||
|
`lists` `<C-Space>` (also `<C-@>`/`<Nul>`), `gnt`, `gln`,
|
||||||
|
`glp`, `glx`, `glh`, `gll`, `gLh`, `gLl`, `glr`,
|
||||||
|
`gLr`, `gl-`, `gl*`, `gl#`, `gl1`, `gli`, `glI`,
|
||||||
|
`gla`, `glA`, `gL-`, `gL*`, `gL#`, `gL1`, `gLi`,
|
||||||
|
`gLI`, `gLa`, `gLA`, `gl`, `gL`, `o`, `O`; insert
|
||||||
|
`<C-D>`, `<C-T>`, `<C-L><C-J>`, `<C-L><C-K>`,
|
||||||
|
`<C-L><C-M>`, `<CR>`
|
||||||
`headers` `=`, `-`, `]]`, `[[`, `]=`, `[=`, `]u`, `[u`
|
`headers` `=`, `-`, `]]`, `[[`, `]=`, `[=`, `]u`, `[u`
|
||||||
`table_editing` `gqq`, `<A-Left>`, `<A-Right>`, insert `<Tab>`
|
`table_editing` `gqq`, `gq1`, `gww`, `gw1`, `<A-Left>`,
|
||||||
|
`<A-Right>`; insert `<Tab>`, `<S-Tab>`
|
||||||
`diary` `<C-Down>`, `<C-Up>`
|
`diary` `<C-Down>`, `<C-Up>`
|
||||||
`html_export` `<Leader>wh`, `<Leader>whh`, `<Leader>wha`
|
`html_export` `<Leader>wh`, `<Leader>whh`, `<Leader>wha`
|
||||||
`text_objects` `ah`, `ih`, `al`, `il`, `a\`, `i\`, `ac`, `ic`
|
`text_objects` `ah`, `ih`, `aH`, `iH`, `al`, `il`, `a\`, `i\`,
|
||||||
|
`ac`, `ic`
|
||||||
|
`mouse` `<2-LeftMouse>`, `<S-2-LeftMouse>`,
|
||||||
|
`<C-2-LeftMouse>`, `<MiddleMouse>`, `<RightMouse>`
|
||||||
|
|
||||||
*g:nuwiki_map_prefix*
|
*g:nuwiki_map_prefix*
|
||||||
`g:nuwiki_map_prefix` `'<Leader>w'`
|
`g:nuwiki_map_prefix` `'<Leader>w'`
|
||||||
|
|||||||
@@ -121,6 +121,7 @@ if !has('nvim')
|
|||||||
" :Nuwiki* canonical aliases — Vim side.
|
" :Nuwiki* canonical aliases — Vim side.
|
||||||
command! -buffer -count NuwikiIndex call nuwiki#commands#wiki_index(<count>)
|
command! -buffer -count NuwikiIndex call nuwiki#commands#wiki_index(<count>)
|
||||||
command! -buffer -count NuwikiTabIndex call nuwiki#commands#wiki_tab_index(<count>)
|
command! -buffer -count NuwikiTabIndex call nuwiki#commands#wiki_tab_index(<count>)
|
||||||
|
command! -buffer NuwikiUISelect call nuwiki#commands#wiki_ui_select()
|
||||||
command! -buffer NuwikiDiaryIndex call nuwiki#commands#diary_index()
|
command! -buffer NuwikiDiaryIndex call nuwiki#commands#diary_index()
|
||||||
command! -buffer NuwikiDiaryToday call nuwiki#commands#diary_today()
|
command! -buffer NuwikiDiaryToday call nuwiki#commands#diary_today()
|
||||||
command! -buffer NuwikiDiaryYesterday call nuwiki#commands#diary_yesterday()
|
command! -buffer NuwikiDiaryYesterday call nuwiki#commands#diary_yesterday()
|
||||||
|
|||||||
@@ -42,17 +42,18 @@ M.defaults = {
|
|||||||
-- Per-buffer glue. Each subgroup mirrors vimwiki's
|
-- Per-buffer glue. Each subgroup mirrors vimwiki's
|
||||||
-- `g:vimwiki_key_mappings` shape and can be flipped off
|
-- `g:vimwiki_key_mappings` shape and can be flipped off
|
||||||
-- independently to suppress that group of keymaps.
|
-- independently to suppress that group of keymaps.
|
||||||
|
-- The <Leader>w prefix in wiki_prefix/links/html_export follows map_prefix.
|
||||||
mappings = {
|
mappings = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
wiki_prefix = true, -- <Leader>w*
|
wiki_prefix = true, -- <Leader>w{w,t,s,i}, <Leader>w<Leader>{w,y,t,m,i}
|
||||||
links = true, -- <CR>, <S-CR>, <Tab>, <BS>, +, …
|
links = true, -- <CR>, <S-CR>, <C-CR>, <C-S-CR>, <D-CR>, <M-CR>, <BS>, <Tab>, <S-Tab>, + (n/x), <Leader>w{n,d,r}, <Leader>wc (n/x)
|
||||||
lists = true, -- <C-Space>, gln/glp/glx, gl<Space>, o/O, …
|
lists = true, -- <C-Space>, gnt, gln, glp, glx, glh, gll, gLh, gLl, glr, gLr, gl{-,*,#,1,i,I,a,A}, gL{…}, gl, gL, o, O; insert <C-D>, <C-T>, <C-L><C-J/K/M>, <CR>
|
||||||
headers = true, -- =, -, ]], [[, ]=, [=, ]u, [u
|
headers = true, -- =, -, ]], [[, ]=, [=, ]u, [u
|
||||||
table_editing = true, -- gqq, gq1, gww, gw1, <A-Left>, <A-Right>
|
table_editing = true, -- gqq, gq1, gww, gw1, <A-Left>, <A-Right>; insert <Tab>, <S-Tab>
|
||||||
diary = true, -- <C-Down>, <C-Up>
|
diary = true, -- <C-Down>, <C-Up>
|
||||||
html_export = true, -- <Leader>wh, <Leader>whh
|
html_export = true, -- <Leader>wh, <Leader>whh, <Leader>wha
|
||||||
text_objects = true, -- ah, ih, aH, iH, al, il, a\, i\, ac, ic
|
text_objects = true, -- ah, ih, aH, iH, al, il, a\, i\, ac, ic
|
||||||
mouse = false, -- <2-LeftMouse>, <RightMouse>, … (opt-in)
|
mouse = false, -- <2-LeftMouse>, <S-2-LeftMouse>, <C-2-LeftMouse>, <MiddleMouse>, <RightMouse> (opt-in)
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Folding. `'lsp'` uses the server's `foldingRange`
|
-- Folding. `'lsp'` uses the server's `foldingRange`
|
||||||
|
|||||||
Reference in New Issue
Block a user