Change mappings for window navigation and resizing

Window navigation is reverted to vim's stock key combination, since tmux
is configured to work very similarly (using its prefix instead of
CTRL-W).

Window resizing is done more deterministically by adding/removing
columns/lines instead of using multipliers on the window height/width.
This commit is contained in:
Fernando Schauenburg 2015-06-14 21:27:33 +02:00
parent 195a682fb8
commit 135986389d

18
vimrc
View file

@ -110,19 +110,11 @@ augroup vimrc " {{{
augroup END " }}} augroup END " }}}
" Key mappings {{{ " Key mappings {{{
" split navigations and resizing " window resizing similar to the way I have tmux set up
nnoremap <c-j> <c-w><c-j> nnoremap <c-w><c-k> 5<c-w>+
nnoremap <c-k> <c-w><c-k> nnoremap <c-w><c-j> 5<c-w>-
nnoremap <c-l> <c-w><c-l> nnoremap <c-w><c-h> 5<c-w><
nnoremap <c-h> <c-w><c-h> nnoremap <c-w><c-l> 5<c-w>>
nnoremap <c-w><c-k> :execute "resize " . (winheight(0) * 5/4)<cr>
nnoremap <c-w><c-j> :execute "resize " . (winheight(0) * 4/5)<cr>
nnoremap <c-w><c-h> :execute "vertical resize " . (winwidth(0) * 5/4)<cr>
nnoremap <c-w><c-l> :execute "vertical resize " . (winwidth(0) * 4/5)<cr>
" fast navigation of matchpairs ({[]})
nnoremap <tab> %
vnoremap <tab> %
" retain selection when indenting/unindenting in visual mode " retain selection when indenting/unindenting in visual mode
vnoremap > ><cr>gv vnoremap > ><cr>gv