feat(parity): close the entire P3 Commands section
CI / cargo fmt --check (push) Successful in 17s
CI / cargo clippy (push) Successful in 24s
CI / cargo test (push) Successful in 42s
CI / editor keymaps (push) Successful in 1m40s

All six remaining command gaps (client-side; no server change):

- VimwikiRenameFile: bare -> -nargs=? (arg accepted-ignored; rename still
  delegates to the LSP rename prompt). No more E488.

- VimwikiVar / NuwikiVar: get/set the client config (upstream vimwiki#vars#cmd).
  No arg prints config (Vim: g:nuwiki_*; Neovim: resolved setup() opts), one arg
  gets a key, two+ sets it. Global command, both clients.

- VimwikiReturn / NuwikiReturn: command form of the smart <CR> continuation —
  enters insert at EOL and fires the <CR> mapping (return_cmd / vimwiki_return).
  Upstream's mode-flag args accepted but unused.

- VimwikiTableAlignQ vs AlignW: corrected — upstream's gqq/gww are identical on
  a table; the only difference is the non-table fallback (native `normal! gqq`
  vs `gww`). New table_align_or_cmd(cmd) aligns on a table row, else runs
  `normal! <cmd>`. Q/gqq/gq1 -> gqq; W/gww/gw1 -> gww; NuwikiTableAlign -> gqq.

- VimwikiSearch / VWS: scope the lvimgrep to the current wiki's root (resolved
  client-side) over <root>/**/*<ext>, not CWD `**`; empty pattern reuses the
  last search. Both clients.

- VimwikiIndex family: add global Vimwiki/NuwikiIndex + TabIndex entry points
  (plugin/nuwiki.vim + init.lua _setup_global_commands, with -count), so a wiki
  opens from any buffer. Buffer-local copies still shadow inside wiki buffers.

Tests: surface.{Vimwiki,Nuwiki}{Return,Var}, cmd.VimwikiVar_sets_*,
cmd.global_entry_points (both harnesses). Docs (README + doc/nuwiki.txt) and the
gap doc updated. Neovim 299, Vim 291/18/21 pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-03 01:23:07 +00:00
parent 3865b8bf0e
commit a11b742fc1
11 changed files with 334 additions and 52 deletions
+22 -18
View File
@@ -94,13 +94,13 @@ 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=* VimwikiSearch lvimgrep /<args>/ **
command! -buffer -nargs=* VWS lvimgrep /<args>/ **
command! -buffer -nargs=* VimwikiSearch call nuwiki#commands#search(<q-args>)
command! -buffer -nargs=* VWS call nuwiki#commands#search(<q-args>)
command! -buffer -nargs=* -complete=customlist,nuwiki#complete#pages VimwikiGoto call nuwiki#commands#wiki_goto_page(<q-args>)
command! -buffer VimwikiDeleteFile call nuwiki#commands#delete_file()
command! -buffer VimwikiDeleteLink call nuwiki#commands#delete_file()
command! -buffer VimwikiRenameFile call nuwiki#commands#rename_file()
command! -buffer -nargs=? VimwikiRenameFile call nuwiki#commands#rename_file()
command! -buffer VimwikiRenameLink call nuwiki#commands#rename_file()
command! -buffer VimwikiNextTask call nuwiki#commands#next_task()
command! -buffer -range VimwikiToggleListItem call nuwiki#commands#toggle_list_item_range(<line1>, <line2>)
@@ -118,8 +118,10 @@ 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 -nargs=? VimwikiTableAlignQ call nuwiki#commands#table_align()
command! -buffer -nargs=? VimwikiTableAlignW call nuwiki#commands#table_align()
command! -buffer -nargs=? VimwikiTableAlignQ call nuwiki#commands#table_align_or_cmd('gqq')
command! -buffer -nargs=? VimwikiTableAlignW call nuwiki#commands#table_align_or_cmd('gww')
command! -buffer -nargs=* VimwikiReturn call nuwiki#commands#return_cmd(<f-args>)
command! -buffer -nargs=* NuwikiReturn call nuwiki#commands#return_cmd(<f-args>)
command! -buffer Vimwiki2HTML call nuwiki#commands#export_current()
command! -buffer Vimwiki2HTMLBrowse call nuwiki#commands#export_browse()
@@ -163,7 +165,7 @@ if !has('nvim')
command! -buffer NuwikiGoBackLink execute "normal! \<C-o>"
command! -buffer NuwikiBacklinks call nuwiki#commands#backlinks()
command! -buffer NuwikiDeleteFile call nuwiki#commands#delete_file()
command! -buffer NuwikiRenameFile call nuwiki#commands#rename_file()
command! -buffer -nargs=? NuwikiRenameFile call nuwiki#commands#rename_file()
command! -buffer NuwikiNextTask call nuwiki#commands#next_task()
command! -buffer -range NuwikiToggleListItem call nuwiki#commands#toggle_list_item_range(<line1>, <line2>)
command! -buffer -range NuwikiToggleRejected call nuwiki#commands#reject_list_item_range(<line1>, <line2>)
@@ -209,7 +211,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 -nargs=? NuwikiTableAlign call nuwiki#commands#table_align()
command! -buffer -nargs=? NuwikiTableAlign call nuwiki#commands#table_align_or_cmd('gqq')
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()
@@ -361,10 +363,10 @@ if !has('nvim')
" Tables (and insert-mode table-cell navigation, same surface).
if !get(g:, 'nuwiki_no_table_editing_mappings', 0)
nnoremap <silent><buffer> gqq :call nuwiki#commands#table_align()<CR>
nnoremap <silent><buffer> gq1 :call nuwiki#commands#table_align()<CR>
nnoremap <silent><buffer> gww :call nuwiki#commands#table_align()<CR>
nnoremap <silent><buffer> gw1 :call nuwiki#commands#table_align()<CR>
nnoremap <silent><buffer> gqq :call nuwiki#commands#table_align_or_cmd('gqq')<CR>
nnoremap <silent><buffer> gq1 :call nuwiki#commands#table_align_or_cmd('gqq')<CR>
nnoremap <silent><buffer> gww :call nuwiki#commands#table_align_or_cmd('gww')<CR>
nnoremap <silent><buffer> gw1 :call nuwiki#commands#table_align_or_cmd('gww')<CR>
nnoremap <silent><buffer> <A-Left> :call nuwiki#commands#table_move_left()<CR>
nnoremap <silent><buffer> <A-Right> :call nuwiki#commands#table_move_right()<CR>
inoremap <silent><buffer><expr> <Tab> nuwiki#commands#smart_tab()
@@ -447,12 +449,12 @@ command! -buffer VimwikiBaddLink lua require('nuwiki.commands').badd_l
command! -buffer -nargs=* -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=* VimwikiSearch lvimgrep /<args>/ **
command! -buffer -nargs=* VWS lvimgrep /<args>/ **
command! -buffer -nargs=* VimwikiSearch lua require('nuwiki.commands').search(<q-args>)
command! -buffer -nargs=* VWS lua require('nuwiki.commands').search(<q-args>)
command! -buffer VimwikiDeleteFile lua require('nuwiki.commands').delete_file()
command! -buffer VimwikiDeleteLink lua require('nuwiki.commands').delete_file()
command! -buffer VimwikiRenameFile lua require('nuwiki.commands').rename_file()
command! -buffer -nargs=? VimwikiRenameFile lua require('nuwiki.commands').rename_file()
command! -buffer VimwikiRenameLink lua require('nuwiki.commands').rename_file()
command! -buffer VimwikiNextTask lua require('nuwiki.commands').next_task()
@@ -471,8 +473,10 @@ 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 -nargs=? VimwikiTableAlignQ lua require('nuwiki.commands').table_align()
command! -buffer -nargs=? VimwikiTableAlignW lua require('nuwiki.commands').table_align()
command! -buffer -nargs=? VimwikiTableAlignQ lua require('nuwiki.commands').table_align_or_cmd('gqq')
command! -buffer -nargs=? VimwikiTableAlignW lua require('nuwiki.commands').table_align_or_cmd('gww')
command! -buffer -nargs=* VimwikiReturn lua require('nuwiki.commands').vimwiki_return()
command! -buffer -nargs=* NuwikiReturn lua require('nuwiki.commands').vimwiki_return()
command! -buffer Vimwiki2HTML lua require('nuwiki.commands').export_current()
command! -buffer Vimwiki2HTMLBrowse lua require('nuwiki.commands').export_browse()
@@ -512,7 +516,7 @@ command! -buffer NuwikiDiaryGenerateLinks lua require('nuwiki.commands').
command! -buffer NuwikiFollowLink lua require('nuwiki.commands').follow_link_or_create()
command! -buffer NuwikiBacklinks lua vim.lsp.buf.references()
command! -buffer NuwikiDeleteFile lua require('nuwiki.commands').delete_file()
command! -buffer NuwikiRenameFile lua require('nuwiki.commands').rename_file()
command! -buffer -nargs=? NuwikiRenameFile lua require('nuwiki.commands').rename_file()
command! -buffer NuwikiNextTask lua require('nuwiki.commands').next_task()
command! -buffer -range NuwikiToggleListItem lua require('nuwiki.commands').toggle_list_item_range(<line1>, <line2>)
command! -buffer -range NuwikiToggleRejected lua require('nuwiki.commands').reject_list_item_range(<line1>, <line2>)
@@ -562,7 +566,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 -nargs=? NuwikiTableAlign lua require('nuwiki.commands').table_align()
command! -buffer -nargs=? NuwikiTableAlign lua require('nuwiki.commands').table_align_or_cmd('gqq')
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()