Last active
February 5, 2020 12:36
-
-
Save coot/aad1f470187e2f9aa078a9d3c4922213 to your computer and use it in GitHub Desktop.
Simple dwm like window managment for vim
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
" Simple DWM like window managment for vim windows | |
fun! WinFocus(winnr) | |
" this assumes that windows have a two column layer: master windows on the | |
" left, and right column consists of a list of opened windows | |
if a:winnr == 0 | |
let l:winnr = winnr() | |
else | |
let l:winnr = a:winnr | |
endif | |
if l:winnr == 1 | |
let l:winnr = 2 | |
endif | |
set lazyredraw | |
1wincmd w | |
wincmd K | |
exe l:winnr . "wincmd w" | |
wincmd H | |
set lazyredraw! | |
endfun | |
com -count=0 -addr=windows WinFocus :call WinFocus(<count>) | |
nm <c-w><c-f> :WinFocus<cr> | |
nm <C-w>f :WinFocus<cr> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment