Implemented simple SplitOpen function and command
This commit is contained in:
parent
ce309777fe
commit
619265f363
13
plugin/split-open.vim
Normal file
13
plugin/split-open.vim
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
function! SplitOpenFile(filename)
|
||||||
|
execute("tabedit " . a:filename)
|
||||||
|
let l:file_extension = tolower(fnamemodify(a:filename, ":e"))
|
||||||
|
if l:file_extension == "cpp"
|
||||||
|
execute("FSSplitLeft")
|
||||||
|
execute("wincmd l")
|
||||||
|
elseif l:file_extension == "h"
|
||||||
|
execute("FSSplitRight")
|
||||||
|
execute("wincmd h")
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
command! -nargs=1 SplitOpen :call SplitOpenFile("<args>")
|
Reference in New Issue
Block a user