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 :)

  • 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 paste.ubuntu.com 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

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.

  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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