Added new Split() command to split an existing tab
parent
4896a7c3cd
commit
97d53cf45c
|
@ -49,8 +49,7 @@ function s:addRightSplit(filename)
|
|||
execute("wincmd h")
|
||||
endfunction
|
||||
|
||||
function! splitopen#SplitOpenFile(filename)
|
||||
execute("tabedit " . a:filename)
|
||||
function s:splitOpenFile(filename)
|
||||
let extension = s:getFileExtension(a:filename)
|
||||
if s:isLeftSideExtension(extension)
|
||||
call s:addRightSplit(a:filename)
|
||||
|
@ -58,3 +57,12 @@ function! splitopen#SplitOpenFile(filename)
|
|||
call s:addLeftSplit(a:filename)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! splitopen#SplitOpenFile(filename)
|
||||
execute("tabedit " . a:filename)
|
||||
call s:splitOpenFile(a:filename)
|
||||
endfunction
|
||||
|
||||
function! splitopen#SplitFile()
|
||||
call s:splitOpenFile(expand("%:p"))
|
||||
endfunction
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
command! -nargs=1 SplitOpen :call splitopen#SplitOpenFile("<args>")
|
||||
command! Split :call splitopen#SplitFile()
|
||||
|
||||
" map left-split / right-split file extensions
|
||||
if !exists("g:splitopen_extensions")
|
||||
|
|
Loading…
Reference in New Issue