Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com Nov 23 '11 at 10:51

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

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
add comment

2 Answers 2

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

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
add comment

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
add comment

Your Answer

 
discard

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.