Split command and function to plugin and autoload parts to enable delay-loading

This commit is contained in:
Michael Mandl 2019-10-18 13:46:00 +02:00
parent 619265f363
commit b18fb2ab5e
2 changed files with 2 additions and 3 deletions

11
autoload/splitopen.vim Normal file
View file

@ -0,0 +1,11 @@
function splitopen#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