Created
June 12, 2019 04:02
-
-
Save andymass/d465970cc178452eac006840e5e58b2b to your computer and use it in GitHub Desktop.
This file contains 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
function! RepWincmd(...) | |
execute (v:count ? v:count : s:rep[1]) 'wincmd' s:rep[0] | |
endfunction | |
function! s:setup(rep, ...) | |
let s:rep = [a:rep, v:count ? v:count : get(a:000, 0, 1)] | |
set operatorfunc=RepWincmd | |
return 'g@l' | |
endfunction | |
" optional number is the default shift amount | |
nnoremap <expr> <c-w>- <sid>setup('-', 3) | |
nnoremap <expr> <c-w>+ <sid>setup('+', 3) | |
nnoremap <expr> <c-w>< <sid>setup('<', 5) | |
nnoremap <expr> <c-w>> <sid>setup('>', 5) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment