Skip to content

Instantly share code, notes, and snippets.

@eagletmt
Forked from uasi/gist:358813
Created April 7, 2010 13:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eagletmt/358862 to your computer and use it in GitHub Desktop.
Save eagletmt/358862 to your computer and use it in GitHub Desktop.
" 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