-
-
Save eagletmt/358862 to your computer and use it in GitHub Desktop.
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
" A .vimrc snippet that allows you to move around windows beyond tabs | |
nnoremap <silent> <Tab> :<C-u>call <SID>NextWindowOrTab()<CR> | |
nnoremap <silent> <S-Tab> :<C-u>call <SID>PreviousWindowOrTab()<CR> | |
function! s:NextWindowOrTab() | |
if winnr() < winnr("$") | |
wincmd w | |
else | |
tabnext | |
1wincmd w | |
endif | |
endfunction | |
function! s:PreviousWindowOrTab() | |
if winnr() > 1 | |
wincmd W | |
else | |
tabprevious | |
execute winnr("$") . "wincmd w" | |
endif | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment