Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Apparently Ubuntu 11.10 uses Vim when I type

vi filename

How do I force Ubuntu to use Vi instead?

share|improve this question
add comment

5 Answers

up vote 16 down vote accepted

You need to install the actual vi package, which is nvi on Ubuntu.

sudo apt-get install nvi

You might also need to run the line below if nvi isn't picked up automatically as the default provider for vi.

sudo update-alternatives --config vi

share|improve this answer
3  
I think you want sudo update-alternatives --config editor –  Randy Fay Apr 7 '13 at 22:01
add comment

man update-alternatives

vi even get special mention as an example.

share|improve this answer
1  
A very useful man page. They say it's better to teach someone how to fish than to just give him a fish... probably the down-voter didn't agree with that. I upvoted you to cancel it :) –  Chan-Ho Suh Mar 8 '12 at 2:48
2  
This answer doesn't really answer the question, does it? –  jokerdino Mar 9 '12 at 6:21
add comment

Check out:

Decide which vi-compatible tool you want to use.

vim, elvis, nvi, vigor (etc). You may want to study the output of apt-cache search editor |grep vi and look for other alternatives. nvi claims to be "bug for bug" compatible with vi.

Once you've done that, install the package:

apt-get install $YOURCHOICE

then run

update-alternatives --config vi

and choose $YOURCHOICE as the one to set as "vi".

share|improve this answer
add comment

If by any chance you just want to get rid of Vim specific features, you can also make sure that Vim runs in compatible mode.

share|improve this answer
add comment

vim is set as your default editor. Put this as your default editor by setting this environment variable--> export EDITOR=vi

share|improve this answer
1  
This won't work if the vi symlink is still pointing to vim. –  Leon Nardella Mar 8 '12 at 16:59
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.