Merge pull request #1 from mandlm/develop

Release first working version
pull/8/head v0.0.1
mandlm 2019-10-18 13:32:59 +02:00 committed by GitHub
commit 3c7c606541
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View File

@ -1 +1,3 @@
# vim-split-open # vim-split-open
This is my first vim plugin. It provides a command to open a combination of c++ source and header file in a new tab split side-by-side.

13
plugin/split-open.vim Normal file
View 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>")