From 734d0143675e64966881ee62f89391d3c2b4c06d Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 18 Dec 2016 13:02:51 -0600 Subject: [PATCH] Added the option to open vimwiki in a pane. 1 tabedit 2 split 3 vsplit Similar to opening a tab,:: vimwiki#base#goto_index(1, 1) we can now open a split with:: vimwiki#base#goto_index(1, 2) and a vertical split with:: vimwiki#base#goto_index(1, 3) --- autoload/vimwiki/base.vim | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/autoload/vimwiki/base.vim b/autoload/vimwiki/base.vim index a246081..07e3e72 100644 --- a/autoload/vimwiki/base.vim +++ b/autoload/vimwiki/base.vim @@ -1325,16 +1325,18 @@ function! vimwiki#base#goto_index(wnum, ...) "{{{ let idx = 0 endif - if a:0 == 1 + if a:1 == 1 let cmd = 'tabedit' - elseif a:0 == 2 - let cmd = 'sp' - elseif a:0 == 3 - let cmd = 'vsp' + elseif a:1 == 2 + let cmd = 'split' + elseif a:1 == 3 + let cmd = 'vsplit' else let cmd = 'edit' endif + echomsg 'Passed argument '.a:0.'. Using cmd '.cmd + call Validate_wiki_options(idx) call vimwiki#base#edit_file(cmd, \ VimwikiGet('path', idx).VimwikiGet('index', idx).