Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Instead, they give A, B, C, D

I am using vi.

share|improve this question

migrated from Nov 4 '09 at 19:28

This question came from our site for professional and enthusiast programmers.

up vote 7 down vote accepted

vi doesn't have support for arrow keys. However, chances are you're actually using vim, which vi is often symlinked to for compatibility (I'm not certain what Ubuntu does, so I'm just guessing). Although vim supports the arrow keys, they tend to be disabled when run as vi.

If you are using vim, you can try typing the following command:

:set nocompatible

and see if that fixes the problem. This can also be loaded into your ~/.vimrc configuration file to load automatically every time you start the program.

Alternatively, you can run vim instead of vi.

share|improve this answer
Running vim in mintty (Cygwin) didn't solve the problem for me - but :set nocompatible did. Thanks. – Matt Ball May 23 '11 at 18:46

vi never did and never will support arrow keys. The correct movement keys in vi are h,jk,l. I suggest you learn to use vi this way, or switch to another text editor. nano is popular and straightforward for small tasks. vim is popular for people who like vi but want extra features like syntax coloring, and yes, arrow key support.

share|improve this answer

You are probably using an old version of vi. In older versions, you would navigate using the H, J, K, and L keys. To get the latest vi, do

sudo apt-get install vim

If you want the GUI too, use

sudo apt-get install vim-gnome
share|improve this answer
That's vim, not vi. – grawity Nov 5 '09 at 15:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .