Skip to content

Instantly share code, notes, and snippets.

@gists-app-test
Forked from aharisu/window_resize_mode
Created September 12, 2012 14:32
Show Gist options
  • Save gists-app-test/3707000 to your computer and use it in GitHub Desktop.
Save gists-app-test/3707000 to your computer and use it in GitHub Desktop.
Vim上のWindowサイズ変更をお手軽に
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