Linux vi arrow keys broken in insert mode

josh picture josh · May 1, 2009 · Viewed 60.6k times · Source

My arrow keys don't work in vi in insert mode at home, they just each insert a newline and a capital letter, like 'A'. Is there a way to fix that?

Answer

Brian Agnew picture Brian Agnew · May 1, 2009

I presume you're using vim as this is tagged as Linux. Try:

:set nocompatible

(You may want to configure your .vimrc with this by adding this command to it. Create a new .vimrc file if not already present in your home directory, run echo $HOME to check home directory path.)