Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

When I enter mode in vim, all control keys (like arrow keys, delete keys etc.) produce characters instead of expected control behaviour. How can I change this? Thanks :)

share|improve this question
Works for me. Can you post the contents of /etc/vim/usr/share/vim/vimcurrent/debian.vim, /etc/vim/vimrc, and if present ~/.vimrc? You can use a link to instead of pasting everything into your question. – htorque Dec 6 '10 at 12:40
create a blank ~/.vimrc and restart vim. does that help? – karthick87 Dec 6 '10 at 12:55
Lol, I only had Vi and just installed Vim. Now it works perfectly.. don't know if there is still something to post or to be solved now :s thanks for the help :) – Lucasmus Dec 6 '10 at 12:59
Heh, don't worry - such things happen! :) IIRC you can close/delete your own questions. – htorque Dec 6 '10 at 13:35
up vote 2 down vote accepted

Try installing vim, instead. This is the default behavior of vi. If you have vim installed, the best way to get vim behavior is to touch .vimrc in your home directory.

share|improve this answer
Now that's a revelation. I had the same problem, and after reading this answer, I checked whether on my system it's vi or vim by starting vi with no filename given. The welcome screen clearly stated "vi improved". I then found out that this is actually from the package "vim-tiny". After installing vim everything works as expected. However I don't understand how Ubuntu cannot provide a properly working version of vim in the default install. :-( – Axel Nov 2 '12 at 20:06
@Axel vim may also behave this way. I just updated my answer. – kzh Nov 27 '12 at 19:41

This may happen if

  1. you're actually using old vi not vim
  2. vim doesn't recognize or know your terminal type. in the shell you invoked vi from, type

    echo $TERM
share|improve this answer

Your Answer


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.