Created
May 2, 2017 18:32
-
-
Save auxiliary/091684e00bfa69fe2a2028e6ff331233 to your computer and use it in GitHub Desktop.
Automatic Vim Layouts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Vim Layouts (pure Vim version) | |
argdelete * | |
bufdo argadd %:p | |
let args = split(expand("##")) | |
let counter = 0 | |
for i in args | |
if counter % 4 == 0 | |
if counter == 0 | |
silent exe "edit" i | |
else | |
silent exe "tabedit" i | |
endif | |
else | |
if counter % 4 == 1 | |
silent exe "vsplit" i | |
else | |
if counter % 4 == 3 | |
silent exe "normal \<C-w>l" | |
endif | |
silent exe "split" i | |
endif | |
endif | |
let counter += 1 | |
endfor |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment