Tuesday, October 5, 2010

The 'vi' arrow keys not working in Ubuntu

Most people get this issue of arrow keys not working for 'vi' in Ubuntu. Instead, it displays A, B, C, and D characters.

This is because the default 'vi' in Ubuntu is a vi 'light' version (that is the vim-tiny package). This does not use the arrow keys as you would expect.

If you want the arrow keys to function you have to install the 'full' vim package. By this you not only get the arrow keys working but also other nice features such as colored syntax.

Just installing the 'vim' package should get you fixed up. Try:

sudo apt-get install vim
or
sudo apt-get install vim-full

'vim-full' will install all the vim related package and the dependencies, that includes gnome libs, etc... if you don't use gnome and just want to fix this issue in the text mode you can also run :

sudo apt-get install vim-runtime

9 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Thanks man..it works for me

    ReplyDelete
  3. when i type sudo apt......... it is asking for a password and the keyboard keys are not working
    plzzz help

    ReplyDelete
    Replies
    1. That's because what you enter next is considered as a password and isn't echoed on the screen( that's why it looks like the keyboard keys are not working)
      For sudo to work, you need to enable the user in the sudoers group. You need to be logged in as root( admin in Ubuntu) to do that. Google the ways to add user to sudoers group.

      Delete
  4. when i typed this it asks a password and keyboard stops working....plz can anyone help sought this out

    ReplyDelete
  5. Awesome. :D Thanks breh! Ha ha

    ReplyDelete
  6. Thanks a lot worked for me

    ReplyDelete