How to make Vi default?

Apparently Ubuntu 11.10 uses Vim when I type

vi filename

How do I force Ubuntu to use Vi instead?


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


man update-alternatives

vi even get special mention as an example.


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".


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.