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
- Control Ubuntu and Mac OS X from one computer
I just installed Synergy on my Ubuntu and Mac OS- Fixing Ubuntu 8.10
I suppose you could say I'm a long time Debian/Ubuntu- Unix: The Good, The Bad, and the Ugly
While searching using a popular search engine for Bash help
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!
Responses to “Vim’s cursor keys work in Mac OS X again”
Leave a Reply