Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

They work just fine if I use Terminal and start a vim session, but under iTerm I have to resort to using H-J-K-L to do left-up-down-right movement.

In both Terminal and iTerm TERM=xterm-color. My .vimrc is quite lean and there are no key bindings set in there that would causing this problem.

iTerm v0.10.

share|improve this question

3 Answers 3

up vote 3 down vote accepted

Try the following:

  1. From the Bookmarks menu item, select Manage Bookmarks....
  2. Choose the Default bookmark and click the edit icon.
  3. Change the Keyboard setting to Global.
share|improve this answer
    
That did the trick. Thanks. –  Ian C. Oct 21 '10 at 17:29
    
I got the same problem on iTerm2. There's no Bookmarks menu :( –  Wei Hu Apr 6 '11 at 0:31
1  
@Wei: They're called Profiles in iTerm2. Profiles -> Open Profiles... and from there you can load the xterm defaults for Keyboard for the profile(s). –  Ian C. Apr 6 '11 at 16:54
    
@Ian, thanks. I found the settings but loading the xterm defaults didn't fix the problem. –  Wei Hu Apr 6 '11 at 22:31
    
@WeiHu: The original suggestion from sentinel was to load the Global setting, not the xterm one, and I expect this carries over to iTerm2 - I'll try as soon as I install iTerm2. I know that Ian C. wrote xterm, but maybe that was a typo. –  Blaisorblade Aug 2 '12 at 22:57

The following worked for me.

In iTerm2:

  • Profiles -> Open Profiles...
  • Edit Profiles...
  • Keys tab
  • From Load Preset... drop-down, pick Terminal.app compatibility
share|improve this answer

This is how I fixed:

nnoremap <silent> <ESC>^[A <Nop>
nnoremap <silent> <ESC>^[B <Nop>
nnoremap <silent> <ESC>^[D <Nop>
nnoremap <silent> <ESC>^[C <Nop>

Note:

The "^[" characters must not be typed, instead you get them by doing: Ctrl-V and pressing the corresponding cursor arrow position (up,down,left,right).

Tested with: iTerm2 (Build 1.0.0.20140629)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.