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?

link|improve this question
1  
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
4  
Nope. I suspect unset TERM variable (or wrong value). is this perhaps over ssh/screen? – sehe Nov 23 '11 at 10:28
feedback

migrated from stackoverflow.com Nov 23 '11 at 10:51

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

1 Answer

up vote 2 down vote accepted

Ubuntu comes with vim-tiny, which IMHO sucks.

you need to install vim

do

sudo apt-get install vim

link|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
feedback

Your Answer

 
or
required, but never shown

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