Debian and Ubuntu use a system where symlinks are used to point to alternatives. This is managed using update-alternatives
. (man 8 update-altnernatives
)
You'll find /usr/bin/vi
is symlinked to /etc/alternatives/vi
and that is symlinked to something like /usr/bin/vim.gnome
.
The following command will show you which binaries you have installed that provide vi functionality:
sudo update-alternatives --list vi
This will let you pick a vi binary interactively:
sudo update-alternatives --config vi
This will let you pick one manually, for example:
sudo update-alternatives --set vi /usr/bin/nvi
This will let you revert to automatic settings:
sudo update-alternatives --auto vi
Like others have said, vim can run in vi compatibility mode, but there's a pretty basic vi clone called nvi that you can install as well.
sudo apt-get install nvi
2On many systems vi is a symlink to vim. (If it is a symlink you probably can not open classic vi) – FDinoff – 2014-12-13T17:05:09.907
1... to check that: type
ls -l /usr/bin/vi
tis will give you/usr/bin/vi -> /etc/alternatives/vi
then typels -l /etc/alternatives/vi
you will get/etc/alternatives/vi -> /usr/bin/vim.basic
– αғsнιη – 2014-12-13T18:25:43.227