From 8dc4050b76466170322761f925bfcaa54eeb64e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Fr=C3=B3es=20Franco?= Date: Sun, 31 May 2026 19:40:06 +0000 Subject: [PATCH] fix(commands)+docs: even out :NuwikiUISelect; exhaustive subgroup key lists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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__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 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) --- README.md | 44 ++++++++++++++++++++++--------------------- doc/nuwiki.txt | 29 ++++++++++++++++++++++------ ftplugin/vimwiki.vim | 1 + lua/nuwiki/config.lua | 13 +++++++------ 4 files changed, 54 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index b1eee0f..d507cb1 100644 --- a/README.md +++ b/README.md @@ -251,15 +251,15 @@ require('nuwiki').setup({ -- Keymap groups. Flip subgroups off independently. Defaults all on. mappings = { enabled = true, - wiki_prefix = true, -- w* - links = true, -- , , , , +, … - lists = true, -- , gln/glp/glx, gl/gL, o/O, … + wiki_prefix = true, -- w{w,t,s,i}, w{w,y,t,m,i} + links = true, -- , , , , , , , , , + (n/x), w{n,d,r}, wc (n/x) + lists = true, -- , gnt, gln, glp, glx, glh, gll, gLh, gLl, glr, gLr, gl{-,*,#,1,i,I,a,A}, gL{…}, gl, gL, o, O; insert , , , headers = true, -- =, -, ]], [[, ]=, [=, ]u, [u - table_editing = true, -- gqq, , , in insert mode + table_editing = true, -- gqq, gq1, gww, gw1, , ; insert , diary = true, -- , - html_export = true, -- wh, whh + html_export = true, -- wh, whh, wha text_objects = true, -- ah, ih, aH, iH, al, il, a\, i\, ac, ic - mouse = false, -- <2-LeftMouse>, , … (opt-in) + mouse = false, -- <2-LeftMouse>, , , , (opt-in) }, -- '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`. -| Key | Default | Controls | +The `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 | -| `wiki_prefix` | `true` | `w*` | -| `links` | `true` | ``, ``, ``, ``, `+`, … | -| `lists` | `true` | ``, `gln`/`glp`/`glx`, `gl`/`gL`, `o`/`O`, … | +| `wiki_prefix` | `true` | `ww`, `wt`, `ws`, `wi`, `ww`, `wy`, `wt`, `wm`, `wi` | +| `links` | `true` | ``, ``, ``, ``, ``, ``, ``, ``, ``, `+` (normal + visual), `wn`, `wd`, `wr`, `wc` (normal + visual) | +| `lists` | `true` | `` (also ``/``), `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: ``, ``, ``, ``, ``, `` | | `headers` | `true` | `=`, `-`, `]]`, `[[`, `]=`, `[=`, `]u`, `[u` | -| `table_editing` | `true` | `gqq`, ``, ``, `` (insert) | +| `table_editing` | `true` | `gqq`, `gq1`, `gww`, `gw1`, ``, ``; insert: ``, `` | | `diary` | `true` | ``, `` | -| `html_export` | `true` | `wh`, `whh` | +| `html_export` | `true` | `wh`, `whh`, `wha` | | `text_objects` | `true` | `ah`, `ih`, `aH`, `iH`, `al`, `il`, `a\`, `i\`, `ac`, `ic` | -| `mouse` | `false` | `<2-LeftMouse>`, ``, … (opt-in) | +| `mouse` | `false` | `<2-LeftMouse>`, ``, ``, ``, `` (opt-in) | #### 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_map_prefix` | `'w'` | prefix for the wiki command family | | `g:nuwiki_no_default_mappings` | `0` | `1` skips the whole keymap layer | -| `g:nuwiki_no_wiki_prefix_mappings` | `0` | `1` skips the `w*` group | -| `g:nuwiki_no_links_mappings` | `0` | `1` skips the link group (``, `+`, …) | -| `g:nuwiki_no_lists_mappings` | `0` | `1` skips the list group (``, `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`, ``, insert ``) | -| `g:nuwiki_no_diary_mappings` | `0` | `1` skips the diary nav group (``, ``) | -| `g:nuwiki_no_html_export_mappings` | `0` | `1` skips the HTML export group (`wh*`) | -| `g:nuwiki_no_text_objects_mappings` | `0` | `1` skips the text-object group (`ah`, `il`, …) | +| `g:nuwiki_no_wiki_prefix_mappings` | `0` | `1` skips the `wiki_prefix` group (`ww`, `wt`, `ws`, `wi`, `w{w,y,t,m,i}`) | +| `g:nuwiki_no_links_mappings` | `0` | `1` skips the `links` group (``, ``, ``, ``, ``, ``, ``, ``, ``, `+`, `w{n,d,r,c}`) | +| `g:nuwiki_no_lists_mappings` | `0` | `1` skips the `lists` group (``, `gnt`, `gln`, `glp`, `glx`, `glh`, `gll`, `gLh`, `gLl`, `glr`, `gLr`, `gl{-,*,#,1,i,I,a,A}`, `gL{…}`, `gl`, `gL`, `o`, `O`; insert ``, ``, ``, ``) | +| `g:nuwiki_no_headers_mappings` | `0` | `1` skips the `headers` group (`=`, `-`, `]]`, `[[`, `]=`, `[=`, `]u`, `[u`) | +| `g:nuwiki_no_table_editing_mappings` | `0` | `1` skips the `table_editing` group (`gqq`, `gq1`, `gww`, `gw1`, ``, ``; insert ``, ``) | +| `g:nuwiki_no_diary_mappings` | `0` | `1` skips the `diary` nav group (``, ``) | +| `g:nuwiki_no_html_export_mappings` | `0` | `1` skips the `html_export` group (`wh`, `whh`, `wha`) | +| `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_mouse_mappings` | `0` | `1` enables mouse maps | | `g:nuwiki_binary_path` | _(auto)_ | path to a prebuilt `nuwiki-ls` binary, bypassing the bundled one | diff --git a/doc/nuwiki.txt b/doc/nuwiki.txt index 2169d3e..bf6ca41 100644 --- a/doc/nuwiki.txt +++ b/doc/nuwiki.txt @@ -267,15 +267,32 @@ Vim-specific globals ~ 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.` booleans. Valid groups: - `wiki_prefix` `w*` - `links` ``, ``, ``, ``, `+`, … - `lists` ``, `gl*`, `o`/`O`, insert-mode list edits + These mirror the Lua-side `mappings.` booleans. Every binding in + each group (the `w` prefix follows |g:nuwiki_map_prefix|): + `wiki_prefix` `ww`, `wt`, `ws`, + `wi`, `ww`, + `wy`, `wt`, + `wm`, `wi` + `links` ``, ``, ``, ``, ``, + ``, ``, ``, ``, `+` (n/x), + `wn`, `wd`, `wr`, + `wc` (n/x) + `lists` `` (also ``/``), `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 + ``, ``, ``, ``, + ``, `` `headers` `=`, `-`, `]]`, `[[`, `]=`, `[=`, `]u`, `[u` - `table_editing` `gqq`, ``, ``, insert `` + `table_editing` `gqq`, `gq1`, `gww`, `gw1`, ``, + ``; insert ``, `` `diary` ``, `` `html_export` `wh`, `whh`, `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>`, ``, + ``, ``, `` *g:nuwiki_map_prefix* `g:nuwiki_map_prefix` `'w'` diff --git a/ftplugin/vimwiki.vim b/ftplugin/vimwiki.vim index 5161d60..9b8eb5a 100644 --- a/ftplugin/vimwiki.vim +++ b/ftplugin/vimwiki.vim @@ -121,6 +121,7 @@ if !has('nvim') " :Nuwiki* canonical aliases — Vim side. command! -buffer -count NuwikiIndex call nuwiki#commands#wiki_index() command! -buffer -count NuwikiTabIndex call nuwiki#commands#wiki_tab_index() + command! -buffer NuwikiUISelect call nuwiki#commands#wiki_ui_select() command! -buffer NuwikiDiaryIndex call nuwiki#commands#diary_index() command! -buffer NuwikiDiaryToday call nuwiki#commands#diary_today() command! -buffer NuwikiDiaryYesterday call nuwiki#commands#diary_yesterday() diff --git a/lua/nuwiki/config.lua b/lua/nuwiki/config.lua index 6672ee5..59de8fe 100644 --- a/lua/nuwiki/config.lua +++ b/lua/nuwiki/config.lua @@ -42,17 +42,18 @@ M.defaults = { -- Per-buffer glue. Each subgroup mirrors vimwiki's -- `g:vimwiki_key_mappings` shape and can be flipped off -- independently to suppress that group of keymaps. + -- The w prefix in wiki_prefix/links/html_export follows map_prefix. mappings = { enabled = true, - wiki_prefix = true, -- w* - links = true, -- , , , , +, … - lists = true, -- , gln/glp/glx, gl, o/O, … + wiki_prefix = true, -- w{w,t,s,i}, w{w,y,t,m,i} + links = true, -- , , , , , , , , , + (n/x), w{n,d,r}, wc (n/x) + lists = true, -- , gnt, gln, glp, glx, glh, gll, gLh, gLl, glr, gLr, gl{-,*,#,1,i,I,a,A}, gL{…}, gl, gL, o, O; insert , , , headers = true, -- =, -, ]], [[, ]=, [=, ]u, [u - table_editing = true, -- gqq, gq1, gww, gw1, , + table_editing = true, -- gqq, gq1, gww, gw1, , ; insert , diary = true, -- , - html_export = true, -- wh, whh + html_export = true, -- wh, whh, wha text_objects = true, -- ah, ih, aH, iH, al, il, a\, i\, ac, ic - mouse = false, -- <2-LeftMouse>, , … (opt-in) + mouse = false, -- <2-LeftMouse>, , , , (opt-in) }, -- Folding. `'lsp'` uses the server's `foldingRange`