Docunext


Yet Another Vim Arrow Key Fix

October 10th, 2010

I just setup the awesome vim_config resources available on github for super-charging vim, only to discover that the arrow keys were busted in edit mode.

Instead of moving the cursor, they product A, B, C, or D!

Reading up on the subject revealed that many developers prefer h,j,k, and l for navigation, and avoid navigating entirely in edit mode. Sounds good to me!

I disabled the arrow keys with these .vimrc commands:

inoremap  <Up>     <NOP>
inoremap  <Down>   <NOP>
inoremap  <Left>   <NOP>
inoremap  <Right>  <NOP>
noremap   <Up>     <NOP>
noremap   <Down>   <NOP>
noremap   <Left>   <NOP>
noremap   <Right>  <NOP>

But I still couldn't get rid of those pesky letter, and I needed to because my muscle memory persists.

Thankfully, this hint from a Mac OS X developer suggested setting the TERM environment variable to "linux". I set it in XFCE4 Terminal and ... YAY! It worked! Thanks!

Alas, while it fixed my arrow keys, it squashed my function keys. Nevertheless, I found another solution: remove autoclose from vim_config.

Yearly Indexes: 2003 2004 2006 2007 2008 2009 2010 2011 2012 2013 2015 2019 2020 2022