up vote 1 down vote favorite

Instead, they give A, B, C, D

I am using vi.

flag

75% accept rate

migrated from stackoverflow.com

3 Answers

up vote 4 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.

link|flag
up vote 2 down vote

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.

link|flag
up vote 1 down vote

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
link|flag
That's vim, not vi. – grawity Nov 5 '09 at 15:49

Your Answer

get an OpenID
or
never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.