feat(parity): P3 quick-wins — ShowVersion, gLH/gLL/gLR, Search/Align nargs
Closes four low-risk P3 parity items (gap doc updated):
- VimwikiShowVersion / NuwikiShowVersion: new global command (both clients)
echoing g:nuwiki_version (0.1.0) + the host editor, via
nuwiki#commands#show_version / commands.show_version.
- gLH / gLL / gLR: upstream's case-variant aliases of gLh/gLl/gLr (dedent /
indent whole item, renumber all lists) added in both clients.
- VimwikiSearch / VWS: -nargs=1 -> -nargs=* (Vim + Neovim), so a multi-word
search no longer raises E488 and an empty invocation reuses the last search
pattern. (The lvimgrep-vs-vimwiki-engine difference stays open.)
- VimwikiTableAlignQ / AlignW / NuwikiTableAlign: bare -> -nargs=?, so
`:VimwikiTableAlignQ 2` no longer raises E488 (optional column arg is
accepted-and-ignored; the gqq-align vs gww-align-without-resize split
stays open).
Docs (doc/nuwiki.txt + README) updated for the command and the aliases.
Tests: surface.{Vimwiki,Nuwiki}ShowVersion, map[n].gL{H,L,R} (both
harnesses), cmd.search_and_tablealign_nargs (vim). Neovim 291, Vim
282/18/21 pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -253,7 +253,7 @@ require('nuwiki').setup({
|
|||||||
enabled = true,
|
enabled = true,
|
||||||
wiki_prefix = true, -- <Leader>w{w,t,s,i}, <Leader>w<Leader>{w,y,t,m,i}
|
wiki_prefix = true, -- <Leader>w{w,t,s,i}, <Leader>w<Leader>{w,y,t,m,i}
|
||||||
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)
|
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>, 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>
|
lists = true, -- <C-Space>, gnt, gln, glp, glx, glh, gll, gLh, gLl (aliases gLH/gLL), glr, gLr (alias 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>; insert <Tab>, <S-Tab>
|
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>
|
||||||
@@ -315,7 +315,7 @@ The `<Leader>w` prefix in the `wiki_prefix`, `links`, and `html_export` rows is
|
|||||||
| `enabled` | `true` | master switch for the whole keymap layer |
|
| `enabled` | `true` | master switch for the whole keymap layer |
|
||||||
| `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` |
|
| `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>`, `<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) |
|
| `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>` (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>` |
|
| `lists` | `true` | `<C-Space>` (also `<C-@>`/`<Nul>`), `gnt`, `gln`, `glp`, `glx`, `glh`, `gll`, `gLh`, `gLl`, `gLH`, `gLL`, `glr`, `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`, `gq1`, `gww`, `gw1`, `<A-Left>`, `<A-Right>`; insert: `<Tab>`, `<S-Tab>` |
|
| `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>` |
|
||||||
@@ -388,7 +388,7 @@ For users configuring without Lua.
|
|||||||
| `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 `wiki_prefix` group (`<Leader>ww`, `<Leader>wt`, `<Leader>ws`, `<Leader>wi`, `<Leader>w<Leader>{w,y,t,m,i}`) |
|
| `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 `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_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 `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_lists_mappings` | `0` | `1` skips the `lists` group (`<C-Space>`, `gnt`, `gln`, `glp`, `glx`, `glh`, `gll`, `gLh`, `gLl` (aliases `gLH`/`gLL`), `glr`, `gLr` (alias `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 `headers` group (`=`, `-`, `]]`, `[[`, `]=`, `[=`, `]u`, `[u`) |
|
| `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`, `<A-Left>`, `<A-Right>`; insert `<Tab>`, `<S-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>`) |
|
||||||
|
|||||||
@@ -168,6 +168,13 @@ endfunction
|
|||||||
" from the server, so the picker works from any buffer before a wiki file is
|
" from the server, so the picker works from any buffer before a wiki file is
|
||||||
" ever opened — opening the chosen index then auto-starts the LSP via the
|
" ever opened — opening the chosen index then auto-starts the LSP via the
|
||||||
" FileType autocmd. Plain Vim has no `vim.ui.select`, so use `inputlist()`.
|
" FileType autocmd. Plain Vim has no `vim.ui.select`, so use `inputlist()`.
|
||||||
|
" :VimwikiShowVersion / :NuwikiShowVersion — echo the nuwiki version and the
|
||||||
|
" host editor, mirroring upstream's version banner.
|
||||||
|
function! nuwiki#commands#show_version() abort
|
||||||
|
echo 'nuwiki: ' . get(g:, 'nuwiki_version', '?')
|
||||||
|
echo (has('nvim') ? 'Neovim' : 'Vim') . ': ' . v:version
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! nuwiki#commands#wiki_ui_select() abort
|
function! nuwiki#commands#wiki_ui_select() abort
|
||||||
let l:wikis = nuwiki#commands#wiki_list()
|
let l:wikis = nuwiki#commands#wiki_list()
|
||||||
if empty(l:wikis)
|
if empty(l:wikis)
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ let s:both_forms = [
|
|||||||
\ 'RebuildTags', '2HTML', '2HTMLBrowse', 'All2HTML', 'Rss',
|
\ 'RebuildTags', '2HTML', '2HTMLBrowse', 'All2HTML', 'Rss',
|
||||||
\ 'NormalizeLink', 'RenumberList', 'RenumberAllLists',
|
\ 'NormalizeLink', 'RenumberList', 'RenumberAllLists',
|
||||||
\ 'ListToggle', 'IncrementListItem', 'DecrementListItem',
|
\ 'ListToggle', 'IncrementListItem', 'DecrementListItem',
|
||||||
\ 'CatUrl',
|
\ 'CatUrl', 'ShowVersion',
|
||||||
\ ]
|
\ ]
|
||||||
for s:suffix in s:both_forms
|
for s:suffix in s:both_forms
|
||||||
for s:prefix in ['Nuwiki', 'Vimwiki']
|
for s:prefix in ['Nuwiki', 'Vimwiki']
|
||||||
@@ -189,6 +189,7 @@ let s:mapping_surface = [
|
|||||||
\ ['<C-Space>', 'nx'], ['<C-@>', 'nx'], ['<Nul>', 'nx'],
|
\ ['<C-Space>', 'nx'], ['<C-@>', 'nx'], ['<Nul>', 'nx'],
|
||||||
\ ['gnt', 'n'], ['gln', 'nx'], ['glp', 'nx'], ['glx', 'nx'],
|
\ ['gnt', 'n'], ['gln', 'nx'], ['glp', 'nx'], ['glx', 'nx'],
|
||||||
\ ['glh', 'n'], ['gll', 'n'], ['gLh', 'n'], ['gLl', 'n'],
|
\ ['glh', 'n'], ['gll', 'n'], ['gLh', 'n'], ['gLl', 'n'],
|
||||||
|
\ ['gLH', 'n'], ['gLL', 'n'], ['gLR', 'n'],
|
||||||
\ ['glr', 'n'], ['gLr', 'n'], ['gl', 'n'], ['gL', 'n'],
|
\ ['glr', 'n'], ['gLr', 'n'], ['gl', 'n'], ['gL', 'n'],
|
||||||
\ ['gl-', 'n'], ['gL-', 'n'], ['gl*', 'n'], ['gL*', 'n'],
|
\ ['gl-', 'n'], ['gL-', 'n'], ['gl*', 'n'], ['gL*', 'n'],
|
||||||
\ ['gl#', 'n'], ['gL#', 'n'], ['gl1', 'n'], ['gL1', 'n'],
|
\ ['gl#', 'n'], ['gL#', 'n'], ['gl1', 'n'], ['gL1', 'n'],
|
||||||
@@ -669,6 +670,28 @@ call s:record(
|
|||||||
\ 'cmd.VimwikiListChangeLvl_accepts_range_and_args',
|
\ 'cmd.VimwikiListChangeLvl_accepts_range_and_args',
|
||||||
\ 'err=' . s:lcl_err)
|
\ 'err=' . s:lcl_err)
|
||||||
|
|
||||||
|
" ===== :VimwikiSearch / VWS -nargs=* + :VimwikiTableAlignQ/W -nargs=? =====
|
||||||
|
" Upstream attributes: Search/VWS take -nargs=* (was -nargs=1, so a multi-word
|
||||||
|
" `:VimwikiSearch foo bar` raised E488); TableAlignQ/W take -nargs=? (were bare,
|
||||||
|
" so `:VimwikiTableAlignQ 2` raised E488). lvimgrep/align run for real here, so
|
||||||
|
" swallow any non-attribute error and assert only that E488 is gone.
|
||||||
|
let s:attr_err = ''
|
||||||
|
try
|
||||||
|
silent! VimwikiSearch foo bar
|
||||||
|
silent! VWS foo bar
|
||||||
|
silent! VimwikiTableAlignQ 2
|
||||||
|
silent! VimwikiTableAlignW 2
|
||||||
|
silent! NuwikiTableAlign 2
|
||||||
|
catch /E488/
|
||||||
|
let s:attr_err = v:exception
|
||||||
|
catch
|
||||||
|
" runtime errors (no match, empty table, …) are expected and fine here.
|
||||||
|
endtry
|
||||||
|
call s:record(
|
||||||
|
\ s:attr_err ==# '' ? 1 : 0,
|
||||||
|
\ 'cmd.search_and_tablealign_nargs',
|
||||||
|
\ 'err=' . s:attr_err)
|
||||||
|
|
||||||
" ===== :VimwikiRemoveDone -bang -range =====
|
" ===== :VimwikiRemoveDone -bang -range =====
|
||||||
" Upstream is `-range`; nuwiki had `-bang` only, so `:'<,'>VimwikiRemoveDone`
|
" Upstream is `-range`; nuwiki had `-bang` only, so `:'<,'>VimwikiRemoveDone`
|
||||||
" raised E481. Now `-bang -range`: a ranged invocation must parse (no E481),
|
" raised E481. Now `-bang -range`: a ranged invocation must parse (no E481),
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ vim.defer_fn(function()
|
|||||||
'RebuildTags', '2HTML', '2HTMLBrowse', 'All2HTML', 'Rss',
|
'RebuildTags', '2HTML', '2HTMLBrowse', 'All2HTML', 'Rss',
|
||||||
'NormalizeLink', 'RenumberList', 'RenumberAllLists',
|
'NormalizeLink', 'RenumberList', 'RenumberAllLists',
|
||||||
'ListToggle', 'IncrementListItem', 'DecrementListItem',
|
'ListToggle', 'IncrementListItem', 'DecrementListItem',
|
||||||
'CatUrl',
|
'CatUrl', 'ShowVersion',
|
||||||
}
|
}
|
||||||
for _, suffix in ipairs(both_forms) do
|
for _, suffix in ipairs(both_forms) do
|
||||||
for _, prefix in ipairs({ 'Nuwiki', 'Vimwiki' }) do
|
for _, prefix in ipairs({ 'Nuwiki', 'Vimwiki' }) do
|
||||||
@@ -212,6 +212,8 @@ vim.defer_fn(function()
|
|||||||
{ '<C-Space>', 'nx' }, { '<C-@>', 'nx' }, { '<Nul>', 'nx' },
|
{ '<C-Space>', 'nx' }, { '<C-@>', 'nx' }, { '<Nul>', 'nx' },
|
||||||
{ 'gnt', 'n' }, { 'gln', 'nx' }, { 'glp', 'nx' }, { 'glx', 'nx' },
|
{ 'gnt', 'n' }, { 'gln', 'nx' }, { 'glp', 'nx' }, { 'glx', 'nx' },
|
||||||
{ 'glh', 'n' }, { 'gll', 'n' }, { 'gLh', 'n' }, { 'gLl', 'n' },
|
{ 'glh', 'n' }, { 'gll', 'n' }, { 'gLh', 'n' }, { 'gLl', 'n' },
|
||||||
|
-- Upstream case-variant aliases of gLh/gLl/gLr.
|
||||||
|
{ 'gLH', 'n' }, { 'gLL', 'n' }, { 'gLR', 'n' },
|
||||||
{ 'glr', 'n' }, { 'gLr', 'n' }, { 'gl', 'n' }, { 'gL', 'n' },
|
{ 'glr', 'n' }, { 'gLr', 'n' }, { 'gl', 'n' }, { 'gL', 'n' },
|
||||||
{ 'gl-', 'n' }, { 'gL-', 'n' }, { 'gl*', 'n' }, { 'gL*', 'n' },
|
{ 'gl-', 'n' }, { 'gL-', 'n' }, { 'gl*', 'n' }, { 'gL*', 'n' },
|
||||||
{ 'gl#', 'n' }, { 'gL#', 'n' }, { 'gl1', 'n' }, { 'gL1', 'n' },
|
{ 'gl#', 'n' }, { 'gL#', 'n' }, { 'gl1', 'n' }, { 'gL1', 'n' },
|
||||||
|
|||||||
+25
-12
@@ -173,12 +173,20 @@ fix site.
|
|||||||
|
|
||||||
### Commands
|
### Commands
|
||||||
- [ ] `VimwikiVar` — config-var get/set introspection. _Fix:_ `plugin/nuwiki.vim`.
|
- [ ] `VimwikiVar` — config-var get/set introspection. _Fix:_ `plugin/nuwiki.vim`.
|
||||||
- [ ] `VimwikiShowVersion` — print version (trivial). _Fix:_ `plugin/nuwiki.vim`.
|
- [x] **`VimwikiShowVersion`** _(fixed 2026-06-03)_ — added global
|
||||||
|
`VimwikiShowVersion`/`NuwikiShowVersion` (both clients) echoing
|
||||||
|
`g:nuwiki_version` (`0.1.0`) + the host editor, via
|
||||||
|
`nuwiki#commands#show_version` / `commands.show_version`. Covered by
|
||||||
|
`surface.{Vimwiki,Nuwiki}ShowVersion` in both keymap harnesses.
|
||||||
- [ ] `VimwikiReturn` — no Ex-command (mapping-driven only). _Fix:_ `ftplugin/vimwiki.vim`.
|
- [ ] `VimwikiReturn` — no Ex-command (mapping-driven only). _Fix:_ `ftplugin/vimwiki.vim`.
|
||||||
- [ ] `VimwikiTableAlignQ` vs `AlignW` collapsed to one `table_align` — `gqq`
|
- [ ] `VimwikiTableAlignQ` vs `AlignW` collapsed to one `table_align` — `gqq`
|
||||||
(align) vs `gww` (align w/o resize) distinction lost. _(Re-audit 2026-05-31:
|
(align) vs `gww` (align w/o resize) distinction still lost (the remaining
|
||||||
also note the attr differs — both are defined bare in all four contexts vs
|
open part). _(Re-audit 2026-05-31: also the attr differed — bare vs upstream's
|
||||||
upstream's `-nargs=?`, so `:VimwikiTableAlignQ 2` raises E488.)_
|
`-nargs=?`, so `:VimwikiTableAlignQ 2` raised E488.)_ _Attr part fixed
|
||||||
|
2026-06-03:_ `VimwikiTableAlignQ`/`AlignW` + `NuwikiTableAlign` are now
|
||||||
|
`-nargs=?` in all contexts (the optional column arg is accepted-and-ignored
|
||||||
|
pending the align-vs-resize split), so the E488 is gone. Covered by
|
||||||
|
`cmd.search_and_tablealign_nargs` (`test-keymaps-vim.vim`).
|
||||||
- [x] `VimwikiTable` was `-nargs=1` vs upstream `-nargs=*` (couldn't pass
|
- [x] `VimwikiTable` was `-nargs=1` vs upstream `-nargs=*` (couldn't pass
|
||||||
cols+rows). _Fix:_ all four defs (Vim+Neovim × Vimwiki+Nuwiki) are now
|
cols+rows). _Fix:_ all four defs (Vim+Neovim × Vimwiki+Nuwiki) are now
|
||||||
`-nargs=*` and forward `<f-args>` to `table_insert` (which already parsed
|
`-nargs=*` and forward `<f-args>` to `table_insert` (which already parsed
|
||||||
@@ -224,9 +232,13 @@ fix site.
|
|||||||
`{ all: true }`; the server (`tags_rebuild`) re-indexes **every** configured
|
`{ all: true }`; the server (`tags_rebuild`) re-indexes **every** configured
|
||||||
wiki (via `wikis_snapshot()`) instead of just the current one. `-bang` added to
|
wiki (via `wikis_snapshot()`) instead of just the current one. `-bang` added to
|
||||||
all four command defs.
|
all four command defs.
|
||||||
- [ ] `:VimwikiSearch` / `VWS` uses `lvimgrep`, not vimwiki's search engine.
|
- [ ] `:VimwikiSearch` / `VWS` uses `lvimgrep`, not vimwiki's search engine
|
||||||
_(Re-audit 2026-05-31: also `-nargs=1` in all four contexts vs upstream
|
(the remaining open part — a deliberate, simpler implementation). _(Re-audit
|
||||||
`-nargs=*`.)_
|
2026-05-31: also `-nargs=1` vs upstream `-nargs=*`.)_ _Attr part fixed
|
||||||
|
2026-06-03:_ both are now `-nargs=*` (Vim + Neovim), so a multi-word
|
||||||
|
`:VimwikiSearch foo bar` no longer raises E488 and an empty `:VimwikiSearch`
|
||||||
|
reuses the last search pattern (`lvimgrep //`). Covered by
|
||||||
|
`cmd.search_and_tablealign_nargs` (`test-keymaps-vim.vim`).
|
||||||
- [x] **`VimwikiChangeSymbolTo` / `VimwikiListChangeSymbolI` lack `-range`**
|
- [x] **`VimwikiChangeSymbolTo` / `VimwikiListChangeSymbolI` lack `-range`**
|
||||||
_(new, 2026-05-31 re-audit; fixed same day)_ — upstream both carry
|
_(new, 2026-05-31 re-audit; fixed same day)_ — upstream both carry
|
||||||
`-range -nargs=1`; nuwiki had `-nargs=1` only, so a visual-range invocation
|
`-range -nargs=1`; nuwiki had `-nargs=1` only, so a visual-range invocation
|
||||||
@@ -476,11 +488,12 @@ fix site.
|
|||||||
### Mappings
|
### Mappings
|
||||||
- [ ] Visual `<CR>` normalize-link (visual `+` covers the same intent).
|
- [ ] Visual `<CR>` normalize-link (visual `+` covers the same intent).
|
||||||
- [ ] Insert `<S-CR>` multiline list item.
|
- [ ] Insert `<S-CR>` multiline list item.
|
||||||
- [ ] `gLH` / `gLL` / `gLR` — upstream binds these as case-variant **aliases**
|
- [x] **`gLH` / `gLL` / `gLR`** _(fixed 2026-06-03)_ — upstream binds these as
|
||||||
of `gLh` / `gLl` / `gLr` (same actions: dedent / indent whole item, renumber
|
case-variant **aliases** of `gLh` / `gLl` / `gLr` (dedent / indent whole item,
|
||||||
all lists; upstream `ftplugin/vimwiki.vim:553,555,561`). nuwiki has the
|
renumber all lists; upstream `ftplugin/vimwiki.vim:553,555,561`). nuwiki had
|
||||||
lowercase forms but not the uppercase-suffix aliases. Cosmetic — same effect,
|
only the lowercase forms. _Fix:_ added the uppercase-suffix aliases (same
|
||||||
redundant keys.
|
actions) in both clients (`lua/nuwiki/keymaps.lua`, `ftplugin/vimwiki.vim`).
|
||||||
|
Covered by `map[n].gL{H,L,R}` in both harnesses.
|
||||||
- [x] **`<D-CR>` (Cmd+Return) tab-drop alias** _(new, 2026-05-31 re-audit)_ —
|
- [x] **`<D-CR>` (Cmd+Return) tab-drop alias** _(new, 2026-05-31 re-audit)_ —
|
||||||
added `<D-CR>` → `follow_link_drop` alongside `<C-S-CR>` in both clients
|
added `<D-CR>` → `follow_link_drop` alongside `<C-S-CR>` in both clients
|
||||||
(`lua/nuwiki/keymaps.lua`, `ftplugin/vimwiki.vim`); docs updated. Covered by
|
(`lua/nuwiki/keymaps.lua`, `ftplugin/vimwiki.vim`); docs updated. Covered by
|
||||||
|
|||||||
+8
-3
@@ -349,6 +349,11 @@ Wiki / navigation ~
|
|||||||
Pick a wiki from a list (multi-wiki only). Uses |vim.ui.select| on
|
Pick a wiki from a list (multi-wiki only). Uses |vim.ui.select| on
|
||||||
Neovim, |inputlist()| on Vim.
|
Neovim, |inputlist()| on Vim.
|
||||||
|
|
||||||
|
*:NuwikiShowVersion*
|
||||||
|
:NuwikiShowVersion
|
||||||
|
Echo the nuwiki version (`g:nuwiki_version`) and the host editor.
|
||||||
|
Also available as `:VimwikiShowVersion`.
|
||||||
|
|
||||||
*:NuwikiGoto*
|
*:NuwikiGoto*
|
||||||
:NuwikiGoto {page}
|
:NuwikiGoto {page}
|
||||||
Open `{page}.wiki` by name.
|
Open `{page}.wiki` by name.
|
||||||
@@ -611,10 +616,10 @@ Lists (normal mode) ~
|
|||||||
gnt Jump to the next unfinished task.
|
gnt Jump to the next unfinished task.
|
||||||
glh Dedent the current list item.
|
glh Dedent the current list item.
|
||||||
gll Indent the current list item.
|
gll Indent the current list item.
|
||||||
gLh Dedent the item including its sublist.
|
gLh Dedent the item including its sublist. (alias: gLH)
|
||||||
gLl Indent the item including its sublist.
|
gLl Indent the item including its sublist. (alias: gLL)
|
||||||
glr Renumber the current ordered list.
|
glr Renumber the current ordered list.
|
||||||
gLr Renumber every ordered list in the buffer.
|
gLr Renumber every ordered list in the buffer. (alias: gLR)
|
||||||
gl<sym> Set the current item's marker to <sym>, where <sym> is one
|
gl<sym> Set the current item's marker to <sym>, where <sym> is one
|
||||||
of `-` `*` `#` `1` (1.) `i` (i)) `I` (I)) `a` (a)) `A` (A)).
|
of `-` `*` `#` `1` (1.) `i` (i)) `I` (I)) `a` (a)) `A` (A)).
|
||||||
For `1)` use `:NuwikiChangeSymbol 1)` (no single-key form).
|
For `1)` use `:NuwikiChangeSymbol 1)` (no single-key form).
|
||||||
|
|||||||
+14
-10
@@ -67,8 +67,8 @@ if !has('nvim')
|
|||||||
command! -buffer VimwikiNextLink call nuwiki#commands#link_next()
|
command! -buffer VimwikiNextLink call nuwiki#commands#link_next()
|
||||||
command! -buffer VimwikiPrevLink call nuwiki#commands#link_prev()
|
command! -buffer VimwikiPrevLink call nuwiki#commands#link_prev()
|
||||||
command! -buffer VimwikiBaddLink call nuwiki#commands#badd_link()
|
command! -buffer VimwikiBaddLink call nuwiki#commands#badd_link()
|
||||||
command! -buffer -nargs=1 VimwikiSearch lvimgrep /<args>/ **
|
command! -buffer -nargs=* VimwikiSearch lvimgrep /<args>/ **
|
||||||
command! -buffer -nargs=1 VWS lvimgrep /<args>/ **
|
command! -buffer -nargs=* VWS lvimgrep /<args>/ **
|
||||||
command! -buffer -nargs=1 -complete=customlist,nuwiki#complete#pages VimwikiGoto call nuwiki#commands#wiki_goto_page(<q-args>)
|
command! -buffer -nargs=1 -complete=customlist,nuwiki#complete#pages VimwikiGoto call nuwiki#commands#wiki_goto_page(<q-args>)
|
||||||
|
|
||||||
command! -buffer VimwikiDeleteFile call nuwiki#commands#delete_file()
|
command! -buffer VimwikiDeleteFile call nuwiki#commands#delete_file()
|
||||||
@@ -91,8 +91,8 @@ if !has('nvim')
|
|||||||
command! -buffer -nargs=? VimwikiNormalizeLink call nuwiki#commands#normalize_link(<args>)
|
command! -buffer -nargs=? VimwikiNormalizeLink call nuwiki#commands#normalize_link(<args>)
|
||||||
command! -buffer VimwikiRenumberList call nuwiki#commands#list_renumber()
|
command! -buffer VimwikiRenumberList call nuwiki#commands#list_renumber()
|
||||||
command! -buffer VimwikiRenumberAllLists call nuwiki#commands#list_renumber_all()
|
command! -buffer VimwikiRenumberAllLists call nuwiki#commands#list_renumber_all()
|
||||||
command! -buffer VimwikiTableAlignQ call nuwiki#commands#table_align()
|
command! -buffer -nargs=? VimwikiTableAlignQ call nuwiki#commands#table_align()
|
||||||
command! -buffer VimwikiTableAlignW call nuwiki#commands#table_align()
|
command! -buffer -nargs=? VimwikiTableAlignW call nuwiki#commands#table_align()
|
||||||
|
|
||||||
command! -buffer Vimwiki2HTML call nuwiki#commands#export_current()
|
command! -buffer Vimwiki2HTML call nuwiki#commands#export_current()
|
||||||
command! -buffer Vimwiki2HTMLBrowse call nuwiki#commands#export_browse()
|
command! -buffer Vimwiki2HTMLBrowse call nuwiki#commands#export_browse()
|
||||||
@@ -182,7 +182,7 @@ if !has('nvim')
|
|||||||
command! -buffer -nargs=? NuwikiNormalizeLink call nuwiki#commands#normalize_link(<args>)
|
command! -buffer -nargs=? NuwikiNormalizeLink call nuwiki#commands#normalize_link(<args>)
|
||||||
command! -buffer NuwikiRenumberList call nuwiki#commands#list_renumber()
|
command! -buffer NuwikiRenumberList call nuwiki#commands#list_renumber()
|
||||||
command! -buffer NuwikiRenumberAllLists call nuwiki#commands#list_renumber_all()
|
command! -buffer NuwikiRenumberAllLists call nuwiki#commands#list_renumber_all()
|
||||||
command! -buffer NuwikiTableAlign call nuwiki#commands#table_align()
|
command! -buffer -nargs=? NuwikiTableAlign call nuwiki#commands#table_align()
|
||||||
command! -buffer -nargs=* NuwikiTable call nuwiki#commands#table_insert(<f-args>)
|
command! -buffer -nargs=* NuwikiTable call nuwiki#commands#table_insert(<f-args>)
|
||||||
command! -buffer NuwikiTableMoveColumnLeft call nuwiki#commands#table_move_column_left()
|
command! -buffer NuwikiTableMoveColumnLeft call nuwiki#commands#table_move_column_left()
|
||||||
command! -buffer NuwikiTableMoveColumnRight call nuwiki#commands#table_move_column_right()
|
command! -buffer NuwikiTableMoveColumnRight call nuwiki#commands#table_move_column_right()
|
||||||
@@ -262,8 +262,12 @@ if !has('nvim')
|
|||||||
nnoremap <silent><buffer> gll :call nuwiki#commands#list_change_level(1, 0)<CR>
|
nnoremap <silent><buffer> gll :call nuwiki#commands#list_change_level(1, 0)<CR>
|
||||||
nnoremap <silent><buffer> gLh :call nuwiki#commands#list_change_level(-1, 1)<CR>
|
nnoremap <silent><buffer> gLh :call nuwiki#commands#list_change_level(-1, 1)<CR>
|
||||||
nnoremap <silent><buffer> gLl :call nuwiki#commands#list_change_level(1, 1)<CR>
|
nnoremap <silent><buffer> gLl :call nuwiki#commands#list_change_level(1, 1)<CR>
|
||||||
|
" Upstream binds case-variant aliases gLH/gLL/gLR == gLh/gLl/gLr.
|
||||||
|
nnoremap <silent><buffer> gLH :call nuwiki#commands#list_change_level(-1, 1)<CR>
|
||||||
|
nnoremap <silent><buffer> gLL :call nuwiki#commands#list_change_level(1, 1)<CR>
|
||||||
nnoremap <silent><buffer> glr :call nuwiki#commands#list_renumber()<CR>
|
nnoremap <silent><buffer> glr :call nuwiki#commands#list_renumber()<CR>
|
||||||
nnoremap <silent><buffer> gLr :call nuwiki#commands#list_renumber_all()<CR>
|
nnoremap <silent><buffer> gLr :call nuwiki#commands#list_renumber_all()<CR>
|
||||||
|
nnoremap <silent><buffer> gLR :call nuwiki#commands#list_renumber_all()<CR>
|
||||||
" gl<sym>/gL<sym>: set the current item's / whole list's marker (upstream
|
" gl<sym>/gL<sym>: set the current item's / whole list's marker (upstream
|
||||||
" VimwikiChangeSymbolTo / ChangeSymbolInListTo). 1) is command-only.
|
" VimwikiChangeSymbolTo / ChangeSymbolInListTo). 1) is command-only.
|
||||||
nnoremap <silent><buffer> gl- :call nuwiki#commands#list_change_symbol('-', 0)<CR>
|
nnoremap <silent><buffer> gl- :call nuwiki#commands#list_change_symbol('-', 0)<CR>
|
||||||
@@ -416,8 +420,8 @@ command! -buffer VimwikiBaddLink lua require('nuwiki.commands').badd_l
|
|||||||
command! -buffer -nargs=1 -complete=customlist,nuwiki#complete#pages VimwikiGoto lua require('nuwiki.commands').wiki_goto_page(<q-args>)
|
command! -buffer -nargs=1 -complete=customlist,nuwiki#complete#pages VimwikiGoto lua require('nuwiki.commands').wiki_goto_page(<q-args>)
|
||||||
command! -buffer VimwikiBacklinks lua vim.lsp.buf.references()
|
command! -buffer VimwikiBacklinks lua vim.lsp.buf.references()
|
||||||
command! -buffer VWB lua vim.lsp.buf.references()
|
command! -buffer VWB lua vim.lsp.buf.references()
|
||||||
command! -buffer -nargs=1 VimwikiSearch lvimgrep /<args>/ **
|
command! -buffer -nargs=* VimwikiSearch lvimgrep /<args>/ **
|
||||||
command! -buffer -nargs=1 VWS lvimgrep /<args>/ **
|
command! -buffer -nargs=* VWS lvimgrep /<args>/ **
|
||||||
|
|
||||||
command! -buffer VimwikiDeleteFile lua require('nuwiki.commands').delete_file()
|
command! -buffer VimwikiDeleteFile lua require('nuwiki.commands').delete_file()
|
||||||
command! -buffer VimwikiDeleteLink lua require('nuwiki.commands').delete_file()
|
command! -buffer VimwikiDeleteLink lua require('nuwiki.commands').delete_file()
|
||||||
@@ -440,8 +444,8 @@ command! -buffer -range -nargs=+ VimwikiListChangeLvl lua require('nuwiki
|
|||||||
command! -buffer -nargs=? VimwikiNormalizeLink lua require('nuwiki.commands').normalize_link(<args>)
|
command! -buffer -nargs=? VimwikiNormalizeLink lua require('nuwiki.commands').normalize_link(<args>)
|
||||||
command! -buffer VimwikiRenumberList lua require('nuwiki.commands').list_renumber()
|
command! -buffer VimwikiRenumberList lua require('nuwiki.commands').list_renumber()
|
||||||
command! -buffer VimwikiRenumberAllLists lua require('nuwiki.commands').list_renumber_all()
|
command! -buffer VimwikiRenumberAllLists lua require('nuwiki.commands').list_renumber_all()
|
||||||
command! -buffer VimwikiTableAlignQ lua require('nuwiki.commands').table_align()
|
command! -buffer -nargs=? VimwikiTableAlignQ lua require('nuwiki.commands').table_align()
|
||||||
command! -buffer VimwikiTableAlignW lua require('nuwiki.commands').table_align()
|
command! -buffer -nargs=? VimwikiTableAlignW lua require('nuwiki.commands').table_align()
|
||||||
|
|
||||||
command! -buffer Vimwiki2HTML lua require('nuwiki.commands').export_current()
|
command! -buffer Vimwiki2HTML lua require('nuwiki.commands').export_current()
|
||||||
command! -buffer Vimwiki2HTMLBrowse lua require('nuwiki.commands').export_browse()
|
command! -buffer Vimwiki2HTMLBrowse lua require('nuwiki.commands').export_browse()
|
||||||
@@ -531,7 +535,7 @@ command! -buffer -nargs=1 NuwikiChangeSymbolInList lua require('nuwiki.comma
|
|||||||
command! -buffer -nargs=? NuwikiNormalizeLink lua require('nuwiki.commands').normalize_link(<args>)
|
command! -buffer -nargs=? NuwikiNormalizeLink lua require('nuwiki.commands').normalize_link(<args>)
|
||||||
command! -buffer NuwikiRenumberList lua require('nuwiki.commands').list_renumber()
|
command! -buffer NuwikiRenumberList lua require('nuwiki.commands').list_renumber()
|
||||||
command! -buffer NuwikiRenumberAllLists lua require('nuwiki.commands').list_renumber_all()
|
command! -buffer NuwikiRenumberAllLists lua require('nuwiki.commands').list_renumber_all()
|
||||||
command! -buffer NuwikiTableAlign lua require('nuwiki.commands').table_align()
|
command! -buffer -nargs=? NuwikiTableAlign lua require('nuwiki.commands').table_align()
|
||||||
command! -buffer -nargs=* NuwikiTable lua require('nuwiki.commands').table_insert(<f-args>)
|
command! -buffer -nargs=* NuwikiTable lua require('nuwiki.commands').table_insert(<f-args>)
|
||||||
command! -buffer NuwikiTableMoveColumnLeft lua require('nuwiki.commands').table_move_column_left()
|
command! -buffer NuwikiTableMoveColumnLeft lua require('nuwiki.commands').table_move_column_left()
|
||||||
command! -buffer NuwikiTableMoveColumnRight lua require('nuwiki.commands').table_move_column_right()
|
command! -buffer NuwikiTableMoveColumnRight lua require('nuwiki.commands').table_move_column_right()
|
||||||
|
|||||||
@@ -276,6 +276,15 @@ end
|
|||||||
-- Pick a wiki and open its index. The list is read straight from config
|
-- Pick a wiki and open its index. The list is read straight from config
|
||||||
-- (no LSP round-trip) so this works from any buffer before a wiki file is
|
-- (no LSP round-trip) so this works from any buffer before a wiki file is
|
||||||
-- ever opened; opening the index then auto-starts the server.
|
-- ever opened; opening the index then auto-starts the server.
|
||||||
|
-- :VimwikiShowVersion / :NuwikiShowVersion — echo the nuwiki version + editor.
|
||||||
|
function M.show_version()
|
||||||
|
local ver = vim.g.nuwiki_version or '?'
|
||||||
|
vim.api.nvim_echo({
|
||||||
|
{ 'nuwiki: ' .. ver .. '\n' },
|
||||||
|
{ 'Neovim: ' .. tostring(vim.version()) },
|
||||||
|
}, false, {})
|
||||||
|
end
|
||||||
|
|
||||||
function M.wiki_ui_select()
|
function M.wiki_ui_select()
|
||||||
local wikis = require('nuwiki.config').wiki_list()
|
local wikis = require('nuwiki.config').wiki_list()
|
||||||
if #wikis == 0 then
|
if #wikis == 0 then
|
||||||
|
|||||||
@@ -70,6 +70,10 @@ local function _setup_global_commands()
|
|||||||
local function ui_select() require('nuwiki.commands').wiki_ui_select() end
|
local function ui_select() require('nuwiki.commands').wiki_ui_select() end
|
||||||
vim.api.nvim_create_user_command('VimwikiUISelect', ui_select, {})
|
vim.api.nvim_create_user_command('VimwikiUISelect', ui_select, {})
|
||||||
vim.api.nvim_create_user_command('NuwikiUISelect', ui_select, {})
|
vim.api.nvim_create_user_command('NuwikiUISelect', ui_select, {})
|
||||||
|
|
||||||
|
local function show_version() require('nuwiki.commands').show_version() end
|
||||||
|
vim.api.nvim_create_user_command('VimwikiShowVersion', show_version, {})
|
||||||
|
vim.api.nvim_create_user_command('NuwikiShowVersion', show_version, {})
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.setup(opts)
|
function M.setup(opts)
|
||||||
|
|||||||
@@ -225,10 +225,17 @@ function M.attach(bufnr, mappings)
|
|||||||
{ desc = 'nuwiki: list dedent subtree' }, bufnr)
|
{ desc = 'nuwiki: list dedent subtree' }, bufnr)
|
||||||
map('n', 'gLl', function() cmd.list_change_level(1, true) end,
|
map('n', 'gLl', function() cmd.list_change_level(1, true) end,
|
||||||
{ desc = 'nuwiki: list indent subtree' }, bufnr)
|
{ desc = 'nuwiki: list indent subtree' }, bufnr)
|
||||||
|
-- Upstream binds case-variant aliases gLH/gLL/gLR == gLh/gLl/gLr.
|
||||||
|
map('n', 'gLH', function() cmd.list_change_level(-1, true) end,
|
||||||
|
{ desc = 'nuwiki: list dedent subtree' }, bufnr)
|
||||||
|
map('n', 'gLL', function() cmd.list_change_level(1, true) end,
|
||||||
|
{ desc = 'nuwiki: list indent subtree' }, bufnr)
|
||||||
map('n', 'glr', cmd.list_renumber,
|
map('n', 'glr', cmd.list_renumber,
|
||||||
{ desc = 'nuwiki: renumber list' }, bufnr)
|
{ desc = 'nuwiki: renumber list' }, bufnr)
|
||||||
map('n', 'gLr', cmd.list_renumber_all,
|
map('n', 'gLr', cmd.list_renumber_all,
|
||||||
{ desc = 'nuwiki: renumber all lists' }, bufnr)
|
{ desc = 'nuwiki: renumber all lists' }, bufnr)
|
||||||
|
map('n', 'gLR', cmd.list_renumber_all,
|
||||||
|
{ desc = 'nuwiki: renumber all lists' }, bufnr)
|
||||||
-- gl<sym>/gL<sym>: set the current item's / whole list's marker (upstream
|
-- gl<sym>/gL<sym>: set the current item's / whole list's marker (upstream
|
||||||
-- VimwikiChangeSymbolTo / ChangeSymbolInListTo). 1) is command-only.
|
-- VimwikiChangeSymbolTo / ChangeSymbolInListTo). 1) is command-only.
|
||||||
for _, pair in ipairs({
|
for _, pair in ipairs({
|
||||||
|
|||||||
@@ -12,6 +12,12 @@ if exists('g:loaded_nuwiki')
|
|||||||
endif
|
endif
|
||||||
let g:loaded_nuwiki = 1
|
let g:loaded_nuwiki = 1
|
||||||
|
|
||||||
|
" Plugin version, surfaced by :VimwikiShowVersion / :NuwikiShowVersion.
|
||||||
|
" Set before the Neovim early-return below so both clients see the global.
|
||||||
|
if !exists('g:nuwiki_version')
|
||||||
|
let g:nuwiki_version = '0.1.0'
|
||||||
|
endif
|
||||||
|
|
||||||
" Resolve the plugin root NOW, while this script is being sourced and
|
" Resolve the plugin root NOW, while this script is being sourced and
|
||||||
" <sfile> is still valid. Commands that need this path must reference
|
" <sfile> is still valid. Commands that need this path must reference
|
||||||
" s:plugin_root — re-expanding <sfile> inside a command body evaluates
|
" s:plugin_root — re-expanding <sfile> inside a command body evaluates
|
||||||
@@ -47,6 +53,10 @@ augroup END
|
|||||||
command! -nargs=0 VimwikiUISelect call nuwiki#commands#wiki_ui_select()
|
command! -nargs=0 VimwikiUISelect call nuwiki#commands#wiki_ui_select()
|
||||||
command! -nargs=0 NuwikiUISelect call nuwiki#commands#wiki_ui_select()
|
command! -nargs=0 NuwikiUISelect call nuwiki#commands#wiki_ui_select()
|
||||||
|
|
||||||
|
" Print the nuwiki version + host editor (upstream's :VimwikiShowVersion).
|
||||||
|
command! -nargs=0 VimwikiShowVersion call nuwiki#commands#show_version()
|
||||||
|
command! -nargs=0 NuwikiShowVersion call nuwiki#commands#show_version()
|
||||||
|
|
||||||
" Global entry-point mappings — work from any buffer, not just .wiki files.
|
" Global entry-point mappings — work from any buffer, not just .wiki files.
|
||||||
" Files are opened directly from config (no LSP required); the server
|
" Files are opened directly from config (no LSP required); the server
|
||||||
" auto-starts via the FileType autocmd once the vimwiki buffer loads.
|
" auto-starts via the FileType autocmd once the vimwiki buffer loads.
|
||||||
|
|||||||
Reference in New Issue
Block a user