Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Instead, they give A, B, C, D

I am using vi.

share|improve this question

migrated from stackoverflow.com Nov 4 '09 at 19:28

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

add comment

3 Answers

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
add comment

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
add comment

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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