October 29th, 2007

Vim’s cursor keys work in Mac OS X again

Apple, by Donncha.

export TERM=linux

Ever since my Macbook died and was fixed again Vim hasn’t worked properly in iTerm.

I’m a big fan of SSH and Screen. SSH to connect to a remote server, and Screen is like a workspace organiser for your SSH session.

First of all the backspace key worked in Vim even when not in insert mode, but worst of all, the cursor keys refused to work and only succeeded in ringing bells in the terminal. Previous attempts at fixing the problem failed but I must have searched for the right terms this time. This review of Mac OS X led me part of the way. Sébastien recommended setting the TERM to “dtterm” but Screen didn’t recognise that. Setting it to “linux” fixes my SSH sessions, and also fixes Vim locally as well!

I added the snippet of code above to my ~/.bash_profile to make the change permanent and everything is back to normal now! I have a vague memory of fixing this before but I wish now I had blogged it then!

You might also like

If you like this post then please subscribe to my full RSS feed. You can also click here to subscribe by email. There are also my fabulous photos and funny videos to explore too!

Back Top

Responses to “Vim’s cursor keys work in Mac OS X again”

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Back Top


Holy Shmoly! is Digg proof thanks to caching by WP Super Cache