How to make Vi default?

16,452

Solution 1

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

Solution 2

man update-alternatives

vi even get special mention as an example.

Solution 3

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

Solution 4

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:
16,452

Related videos on Youtube

ifnDef
Author by

ifnDef

Updated on September 18, 2022

Comments

  • ifnDef
    ifnDef over 1 year

    Apparently Ubuntu 11.10 uses Vim when I type

    vi filename

    How do I force Ubuntu to use Vi instead?

  • Tom
    Tom about 12 years
    This won't work if the vi symlink is still pointing to vim.
  • jokerdino
    jokerdino about 12 years
    This answer doesn't really answer the question, does it?
  • rfay
    rfay about 11 years
    I think you want sudo update-alternatives --config editor