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 realize a difference in vi editor of ReD Hat and Ubuntu. In my company, I'm working in Red Hat. In that, the vi editing commands working as usual. Say, 'dd' to delete,'p' to paste, 'yy' to yank, etc. But in Ubuntu, if I open the vi editor in terminal, then the commands are not working properly.

Even to switch vi to Insert mode, I am supposed to press 'I' many times. I can type coding after some struggle. I can't delete a letter by pressing 'Delete' button. If I press 'Up', 'Down','Left', 'Right' keys, then some alphabets are being written in it.

Why this is happening? How to resolve it? Is this because of Ubuntu?

share|improve this question

migrated from Nov 23 '11 at 10:51

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

Probably, different versions or, most likely, on the one place, vi is really vi, on the other - vi is alias for 'vim'. – Kiril Kirov Nov 23 '11 at 10:22
Nope. I suspect unset TERM variable (or wrong value). is this perhaps over ssh/screen? – sehe Nov 23 '11 at 10:28
up vote 2 down vote accepted

Ubuntu comes with vim-tiny, which IMHO sucks.

you need to install vim


sudo apt-get install vim

share|improve this answer
That doesn't explain the differences that Dinesh is seeing. Those basic commands work in vim-tiny as well as in the larger versions. – garyjohn Nov 23 '11 at 16:48
ubuntu's vi defaults to vi(original) compatibility mode. which behaves like this . To disable it in vi(default) in ubuntu: :set nocompatible. refer bug reported. – Sachin Divekar Nov 23 '11 at 17:12

I got rid of the arrows not working by adding the .vimrc file in my home directory. I found the answer here, under "Additional solution 5". All I have in the file is "set nocompatible", as mentioned above.

However, I highly recommend you installing the full version of vim as Mr. Divekar mentions above.

share|improve this answer

You must log in to answer this question.

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