feat(client): wire full Vimwiki command-parity surface
Register the named :Vimwiki*/:Nuwiki* entry points that previously
existed only as mappings or were missing entirely — including
RemoveSingleCB/RemoveCBInList, CatUrl, TabMakeDiaryNote,
NormalizeLink, Renumber{List,AllLists}, TableAlign, ChangeSymbol(InList),
ListToggle, Increment/DecrementListItem, and the DeleteLink/RenameLink/
GenerateTags compat aliases. Both the Vim (vim-lsp/coc) and Neovim
client functions are added to back them.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
+26
-2
@@ -284,15 +284,16 @@ end
|
||||
|
||||
-- ===== Diary =====
|
||||
|
||||
local function _diary_open(cmd_name)
|
||||
local function _diary_open(cmd_name, tab)
|
||||
return function()
|
||||
exec(cmd_name, uri_args(), function(r)
|
||||
if r and r.uri then open_uri(r.uri) end
|
||||
if r and r.uri then open_uri(r.uri, tab) end
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
M.diary_today = _diary_open('nuwiki.diary.openToday')
|
||||
M.diary_today_tab = _diary_open('nuwiki.diary.openToday', true)
|
||||
M.diary_yesterday = _diary_open('nuwiki.diary.openYesterday')
|
||||
M.diary_tomorrow = _diary_open('nuwiki.diary.openTomorrow')
|
||||
M.diary_index = _diary_open('nuwiki.diary.openIndex')
|
||||
@@ -481,6 +482,18 @@ function M.list_remove_done_all()
|
||||
exec('nuwiki.list.removeDone', uri_args())
|
||||
end
|
||||
|
||||
-- `:VimwikiRemoveSingleCB` — strip the checkbox from the current item only.
|
||||
function M.list_remove_checkbox()
|
||||
exec('nuwiki.list.removeCheckbox', pos_args())
|
||||
end
|
||||
|
||||
-- `:VimwikiRemoveCBInList` — strip checkboxes from every item in the list.
|
||||
function M.list_remove_checkbox_in_list()
|
||||
local args = pos_args()[1]
|
||||
args.whole_list = true
|
||||
exec('nuwiki.list.removeCheckbox', { args })
|
||||
end
|
||||
|
||||
function M.list_renumber()
|
||||
exec('nuwiki.list.renumber', pos_args())
|
||||
end
|
||||
@@ -978,4 +991,15 @@ function M.normalize_link()
|
||||
wrap_cword_as_wikilink()
|
||||
end
|
||||
|
||||
--- Vimwiki `:VimwikiCatUrl` — echo the `file://` URL of the current
|
||||
--- page's HTML export. The server computes the path from the wiki's
|
||||
--- html config; we surface it via `:echo` like upstream.
|
||||
function M.cat_url()
|
||||
exec('nuwiki.link.catUrl', uri_args(), function(url)
|
||||
if type(url) == 'string' and url ~= '' then
|
||||
vim.api.nvim_echo({ { url } }, false, {})
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
Reference in New Issue
Block a user