Bind key in vim for switch window

1

Operation System: OS X

Console: iTerm

sh: zsh

This worked fine i go to bottom window from top:

map <c-down> <c-w><down>
imap <c-down> <esc><c-w><c-down>

But this doesn't work

map <c-right> <c-w><right>
imap <c-right> <esc><c-w><c-right>

Somebody help me !) Tell why....

v.tsurka

Posted 2012-08-18T07:33:53.003

Reputation: 113

2Isn't <C-Right> already used by iTerm? – romainl – 2012-08-18T13:14:30.593

Answers

0

Most of the "Vim Crowd" would agree that not using the arrow keys is a good thing. That is why many vimrc's will include:

nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l

This will allow you to do ctrl - w then jump to up, down, left, right with hjkl bindings. This does not solve your problem with the arrow keys but, does give you a "correct" way to get to your required solution.

Braden

Posted 2012-08-18T07:33:53.003

Reputation: 345