Mac OSX iTerm: Arrow Key Not Working in VI/VIM

If your arrow keys are not working with iTerm during using VI/VIM.
Try add this line into /etc/bashrc or .profile

TERM=linux

After that

source ~/.profile (if you edit in .profile)
source /etc/bashrc (if you edit in bashrc)

Arrow keys working in VI/VIM now? Good luck

8 Responses to “Mac OSX iTerm: Arrow Key Not Working in VI/VIM”

  1. Ómar Kjartan Says:

    Thanks, this has been killing me. As a recent MacOSX convert not being able to use VIM was having a drastic effect on my behavior.

  2. joe Says:

    THAAAAAAAAAAANKS!

  3. Kaitlyn Says:

    THANK YOU SOOOO MUCH!

    I wanted to throw the computer out the window for a good five minutes, and now I’m very, very happy!

    Thank you soo much! :D

    *huggles*
    -Kat

  4. Mar Says:

    There should be an option in the installer script to add this to your user init script.

  5. Rene Jochum Says:

    Thank You,
    You saved my VIM - iTerm live!

  6. eepohboy Says:

    Heh… nice trick. Alternatively, you can learn how to use H,J,K,L to navigate in VI/M. Beats having to use those small arrow keys in the corner…

  7. Paul Ooi Says:

    I don’t really like HJKL :P because am a lazy fellow. :)

  8. Bushmaster Says:

    It is a nice trick however I cannot navigate through yast when am in iTerm.
    Anyone know how to go about it?

Leave a Reply