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:
+13
-3
@@ -47,6 +47,11 @@ if !has('nvim')
|
||||
command! -buffer VimwikiDiaryPrevDay call nuwiki#commands#diary_prev()
|
||||
command! -buffer VimwikiDiaryGenerateLinks call nuwiki#commands#diary_generate_index()
|
||||
command! -buffer VimwikiFollowLink call nuwiki#commands#follow_link_or_create()
|
||||
command! -buffer VimwikiSplitLink split | call nuwiki#commands#follow_link_or_create()
|
||||
command! -buffer VimwikiVSplitLink vsplit | call nuwiki#commands#follow_link_or_create()
|
||||
command! -buffer VimwikiTabnewLink tabnew | call nuwiki#commands#follow_link_or_create()
|
||||
command! -buffer VimwikiTabDropLink call nuwiki#commands#follow_link_drop()
|
||||
command! -buffer VimwikiGoBackLink execute "normal! \<C-o>"
|
||||
command! -buffer VimwikiBacklinks call nuwiki#commands#backlinks()
|
||||
command! -buffer VWB call nuwiki#commands#backlinks()
|
||||
command! -buffer VimwikiNextLink call nuwiki#commands#link_next()
|
||||
@@ -113,6 +118,11 @@ if !has('nvim')
|
||||
command! -buffer NuwikiDiaryNext call nuwiki#commands#diary_next()
|
||||
command! -buffer NuwikiDiaryPrev call nuwiki#commands#diary_prev()
|
||||
command! -buffer NuwikiFollowLink call nuwiki#commands#follow_link_or_create()
|
||||
command! -buffer NuwikiSplitLink split | call nuwiki#commands#follow_link_or_create()
|
||||
command! -buffer NuwikiVSplitLink vsplit | call nuwiki#commands#follow_link_or_create()
|
||||
command! -buffer NuwikiTabnewLink tabnew | call nuwiki#commands#follow_link_or_create()
|
||||
command! -buffer NuwikiTabDropLink call nuwiki#commands#follow_link_drop()
|
||||
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()
|
||||
@@ -196,7 +206,7 @@ if !has('nvim')
|
||||
nnoremap <silent><buffer> <CR> :call nuwiki#commands#follow_link_or_create()<CR>
|
||||
nnoremap <silent><buffer> <S-CR> :split<CR>:call nuwiki#commands#follow_link_or_create()<CR>
|
||||
nnoremap <silent><buffer> <C-CR> :vsplit<CR>:call nuwiki#commands#follow_link_or_create()<CR>
|
||||
nnoremap <silent><buffer> <C-S-CR> :tabnew<CR>:call nuwiki#commands#follow_link_or_create()<CR>
|
||||
nnoremap <silent><buffer> <C-S-CR> :call nuwiki#commands#follow_link_drop()<CR>
|
||||
nnoremap <silent><buffer> <BS> <C-o>
|
||||
nnoremap <silent><buffer> <Tab> /\[\[<CR>:nohlsearch<CR>
|
||||
nnoremap <silent><buffer> <S-Tab> ?\[\[<CR>:nohlsearch<CR>
|
||||
@@ -357,7 +367,7 @@ command! -buffer VimwikiGoBackLink execute "normal! \<C-o>"
|
||||
command! -buffer VimwikiSplitLink split | lua vim.lsp.buf.definition()
|
||||
command! -buffer VimwikiVSplitLink vsplit | lua vim.lsp.buf.definition()
|
||||
command! -buffer VimwikiTabnewLink tabnew | lua vim.lsp.buf.definition()
|
||||
command! -buffer VimwikiTabDropLink tabnew | lua vim.lsp.buf.definition()
|
||||
command! -buffer VimwikiTabDropLink lua require('nuwiki.commands').follow_link_drop()
|
||||
command! -buffer VimwikiNextLink lua require('nuwiki.commands').link_next()
|
||||
command! -buffer VimwikiPrevLink lua require('nuwiki.commands').link_prev()
|
||||
command! -buffer VimwikiBaddLink lua require('nuwiki.commands').badd_link()
|
||||
@@ -465,7 +475,7 @@ command! -buffer NuwikiGoBackLink execute "normal! \<C-o>"
|
||||
command! -buffer NuwikiSplitLink split | lua vim.lsp.buf.definition()
|
||||
command! -buffer NuwikiVSplitLink vsplit | lua vim.lsp.buf.definition()
|
||||
command! -buffer NuwikiTabnewLink tabnew | lua vim.lsp.buf.definition()
|
||||
command! -buffer NuwikiTabDropLink tabnew | lua vim.lsp.buf.definition()
|
||||
command! -buffer NuwikiTabDropLink lua require('nuwiki.commands').follow_link_drop()
|
||||
command! -buffer NuwikiRemoveDone lua require('nuwiki.commands').list_remove_done()
|
||||
command! -buffer -range NuwikiRemoveCheckbox lua require('nuwiki.commands').list_remove_checkbox()
|
||||
command! -buffer NuwikiRemoveCheckboxInList lua require('nuwiki.commands').list_remove_checkbox_in_list()
|
||||
|
||||
Reference in New Issue
Block a user