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

I just installed Ubuntu Server 8 and found vi to be acting strangely (compared to vi on Fedora, CentOS and OSX).

When I use the 'a' command to enter text, pressing the arrow keys results in "C", "D", "B" and "A" to get entered. This makes editing almost impossible..

Am I doing something wrong here?

share|improve this question
up vote 10 down vote accepted

You're probably using the vim-tiny editor that doesn't support arrow key navigation in insert mode; Ubuntu 8.04 doesn't have the vim package installed. Install this, and update your default version of vi:

sudo apt-get install vim
sudo update-alternatives --config vi

Select "vim.basic". You may also want to do this for editor (replace vi in the command above with editor) so the default editor called by other programs (like visudo) is also the right version of vim.

I also advise getting in the habit of hitting ESC from insert mode and using hjkl navigation common to Vi/Vim, rather than using the arrow keys.

share|improve this answer
Thanks, this fixed the problem. :) – Ian Aug 27 '09 at 16:49
It may also be actual vi instead of vim. Being a server they tend to ship with bare minimum. hjkl is the way to go. =-] – Jack M. Sep 28 '09 at 21:26
@jack m.: jtimberman's correct, ubuntu will install the vim-tiny package by default. i think this version of vim is compiled to act like vi, so there won't be much (if any) difference between it and actual vi. – quack quixote Nov 19 '09 at 11:53
aptitude install vim-full

The first thing I do on a new ubuntu install.

share|improve this answer
That will install the vim-gnome package, which is probably undesirable on 'server' systems. – jtimberman Aug 27 '09 at 16:35

another option is to remove vim-tiny:

sudo apt-get remove vim-tiny

and then reinstall vim:

sudo apt-get install vim
share|improve this answer
+1, just because I don't see any reason to keep vim-tiny in the system anymore. – Radu Maris Oct 10 '13 at 14:46

You also might want to do some configuration:

$ cp /usr/share/vim/vimcurrent/vimrc_example.vim ~/.vimrc
$ vim !$    # and adapt it to your needs

The example vimrc has some useful settings and is a good starting point.

(note that you have to adapt the path for other systems, this is debian/ubuntu specific. On Systems that follow upstream vim installation more closely, it is /usr/share/vim/vimrc_example.vim)

share|improve this answer


:set nocompatible

If it works you may consider putting it into your .exrc (w/o colon).

share|improve this answer

You must log in to answer this question.

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