Skip to content

Instantly share code, notes, and snippets.

@auxiliary
Created May 2, 2017 18:32
Show Gist options
  • Save auxiliary/091684e00bfa69fe2a2028e6ff331233 to your computer and use it in GitHub Desktop.
Save auxiliary/091684e00bfa69fe2a2028e6ff331233 to your computer and use it in GitHub Desktop.
Automatic Vim Layouts
" 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