Created
September 12, 2012 13:29
-
-
Save aharisu/3706600 to your computer and use it in GitHub Desktop.
Vim上のWindowサイズ変更をお手軽に変更
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
function g:window_resize_mode() | |
echo 'window resize mode' | |
while 1 | |
let ch = getchar() | |
if ch == 104 " 104 = h | |
execute '2wincmd <' | |
elseif ch == 106 " 106 = j | |
execute "2wincmd -" | |
elseif ch == 107 " 107 = k | |
execute "2wincmd +" | |
elseif ch == 108 " 108 = l | |
execute '2wincmd >' | |
else | |
break | |
endif | |
execute 'redraw' | |
endwhile | |
endfunction | |
nmap <C-W><C-W> :call g:window_resize_mode()<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment