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:
@@ -276,6 +276,15 @@ end
|
||||
-- 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
|
||||
-- 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()
|
||||
local wikis = require('nuwiki.config').wiki_list()
|
||||
if #wikis == 0 then
|
||||
|
||||
@@ -70,6 +70,10 @@ local function _setup_global_commands()
|
||||
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('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
|
||||
|
||||
function M.setup(opts)
|
||||
|
||||
@@ -225,10 +225,17 @@ function M.attach(bufnr, mappings)
|
||||
{ desc = 'nuwiki: list dedent subtree' }, bufnr)
|
||||
map('n', 'gLl', function() cmd.list_change_level(1, true) end,
|
||||
{ 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,
|
||||
{ desc = 'nuwiki: renumber list' }, bufnr)
|
||||
map('n', 'gLr', cmd.list_renumber_all,
|
||||
{ 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
|
||||
-- VimwikiChangeSymbolTo / ChangeSymbolInListTo). 1) is command-only.
|
||||
for _, pair in ipairs({
|
||||
|
||||
Reference in New Issue
Block a user