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