Skip to content

Commit

Permalink
feat: allow split modifiers for WikiLinkFollowSplit
Browse files Browse the repository at this point in the history
refer: #223
  • Loading branch information
lervag committed Apr 29, 2022
1 parent 1c66012 commit ff683a7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion autoload/wiki/buffer.vim
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function! s:init_buffer_commands() abort " {{{1
command! -buffer WikiLinkShow call wiki#link#show()
command! -buffer WikiLinkExtractHeader call wiki#link#set_text_from_header()
command! -buffer WikiLinkFollow call wiki#link#follow()
command! -buffer WikiLinkFollowSplit call wiki#link#follow('vsplit')
command! -buffer WikiLinkFollowSplit call wiki#link#follow('split', <q-mods>)
command! -buffer WikiLinkFollowTab call wiki#link#follow('tabe')
command! -buffer WikiLinkPrev call wiki#nav#prev_link()
command! -buffer WikiLinkReturn call wiki#nav#return()
Expand Down
8 changes: 7 additions & 1 deletion autoload/wiki/url/wiki.vim
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ endfunction

let s:handler = {}
function! s:handler.follow(...) abort dict " {{{1
let l:cmd = a:0 > 0 ? a:1 : 'edit'
if a:0 > 1
let l:cmd = a:2 . ' ' . a:1
elseif a:0 == 1
let l:cmd = a:1
else
let l:cmd = 'edit'
endif

" Check if dir exists
let l:dir = fnamemodify(self.path, ':p:h')
Expand Down
3 changes: 2 additions & 1 deletion doc/wiki.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,8 @@ the commands are also available as mappings of the form `<plug>(wiki-[name])`.
*<plug>(wiki-link-follow-split)*
*WikiLinkFollowSplit*
Similar to |WikiLinkfollow|, except wiki links are followed in a |vsplit|.
Similar to |WikiLinkfollow|, except wiki links are followed in a |split|.
Modifiers such as |:vertical| are allowed.

*<plug>(wiki-link-follow-tab)*
*WikiLinkFollowTab*
Expand Down

0 comments on commit ff683a7

Please sign in to comment.