feat(parity): P3 quick-wins — ShowVersion, gLH/gLL/gLR, Search/Align nargs
CI / cargo fmt --check (push) Successful in 21s
CI / cargo clippy (push) Successful in 26s
CI / cargo test (push) Successful in 36s
CI / editor keymaps (push) Successful in 1m47s

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:
2026-06-03 00:28:51 +00:00
parent 9441fe918c
commit c161f9d21a
11 changed files with 114 additions and 30 deletions
+14 -10
View File
@@ -67,8 +67,8 @@ if !has('nvim')
command! -buffer VimwikiNextLink call nuwiki#commands#link_next()
command! -buffer VimwikiPrevLink call nuwiki#commands#link_prev()
command! -buffer VimwikiBaddLink call nuwiki#commands#badd_link()
command! -buffer -nargs=1 VimwikiSearch lvimgrep /<args>/ **
command! -buffer -nargs=1 VWS lvimgrep /<args>/ **
command! -buffer -nargs=* VimwikiSearch 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 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 VimwikiRenumberList call nuwiki#commands#list_renumber()
command! -buffer VimwikiRenumberAllLists call nuwiki#commands#list_renumber_all()
command! -buffer VimwikiTableAlignQ call nuwiki#commands#table_align()
command! -buffer VimwikiTableAlignW call nuwiki#commands#table_align()
command! -buffer -nargs=? VimwikiTableAlignQ call nuwiki#commands#table_align()
command! -buffer -nargs=? VimwikiTableAlignW call nuwiki#commands#table_align()
command! -buffer Vimwiki2HTML call nuwiki#commands#export_current()
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 NuwikiRenumberList call nuwiki#commands#list_renumber()
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 NuwikiTableMoveColumnLeft call nuwiki#commands#table_move_column_left()
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> gLh :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_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
" VimwikiChangeSymbolTo / ChangeSymbolInListTo). 1) is command-only.
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 VimwikiBacklinks lua vim.lsp.buf.references()
command! -buffer VWB lua vim.lsp.buf.references()
command! -buffer -nargs=1 VimwikiSearch lvimgrep /<args>/ **
command! -buffer -nargs=1 VWS lvimgrep /<args>/ **
command! -buffer -nargs=* VimwikiSearch lvimgrep /<args>/ **
command! -buffer -nargs=* VWS lvimgrep /<args>/ **
command! -buffer VimwikiDeleteFile 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 VimwikiRenumberList lua require('nuwiki.commands').list_renumber()
command! -buffer VimwikiRenumberAllLists lua require('nuwiki.commands').list_renumber_all()
command! -buffer VimwikiTableAlignQ lua require('nuwiki.commands').table_align()
command! -buffer VimwikiTableAlignW lua require('nuwiki.commands').table_align()
command! -buffer -nargs=? VimwikiTableAlignQ 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 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 NuwikiRenumberList lua require('nuwiki.commands').list_renumber()
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 NuwikiTableMoveColumnLeft lua require('nuwiki.commands').table_move_column_left()
command! -buffer NuwikiTableMoveColumnRight lua require('nuwiki.commands').table_move_column_right()