Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@andymass
Created June 12, 2019 04:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andymass/d465970cc178452eac006840e5e58b2b to your computer and use it in GitHub Desktop.
Save andymass/d465970cc178452eac006840e5e58b2b to your computer and use it in GitHub Desktop.
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