This repository has been archived on 2024-12-15. You can view files and clone it, but cannot push or open issues or pull requests.
vim-split-open/plugin/split-open.vim

14 lines
366 B
VimL

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>")