feat(client): add Vim split/tab/back link-follow commands + true tab-drop

The plain-Vim client only defined VimwikiFollowLink; the split/vsplit/
tabnew/tabdrop/back command surface existed only in the Neovim branch.
Add :Vimwiki{Split,VSplit,Tabnew,TabDrop,GoBack}Link (+ :Nuwiki* aliases)
to the Vim branch, backed by a new nuwiki#commands#follow_link_drop()
helper that runs `:tab drop` to reuse an already-open tab.

Both clients now implement real tab-drop: open_uri gains a 'tabdrop'
case and M.follow_link_drop(); the Neovim TabDropLink commands and the
<C-S-CR> mappings (Vim + Lua) are repointed off the old tabnew cheat.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-31 07:54:20 -03:00
parent 00a671e486
commit f65d861f72
4 changed files with 86 additions and 5 deletions
+2 -2
View File
@@ -164,8 +164,8 @@ function M.attach(bufnr, mappings)
{ desc = 'nuwiki: follow link in split' }, bufnr)
map('n', '<C-CR>', function() vim.cmd('vsplit'); cmd.follow_link_or_create() end,
{ desc = 'nuwiki: follow link in vsplit' }, bufnr)
map('n', '<C-S-CR>', function() vim.cmd('tabnew'); cmd.follow_link_or_create() end,
{ desc = 'nuwiki: follow link in new tab' }, bufnr)
map('n', '<C-S-CR>', cmd.follow_link_drop,
{ desc = 'nuwiki: follow link in tab (reuse existing)' }, bufnr)
map('n', '<BS>', '<C-o>', { desc = 'nuwiki: go back', remap = true }, bufnr)
map('n', '<Tab>', link.next, { desc = 'nuwiki: next wikilink' }, bufnr)
map('n', '<S-Tab>', link.prev, { desc = 'nuwiki: prev wikilink' }, bufnr)