Ive just installed ubuntu 16.04.2 32 bit on a digital ocean server.

Digital ocean has tweaked the ubuntu install a bit, for example they have installed full vim as part of the block image they use in their VPS's. I now want to use this - pre-installed - vim as my default editor. so I run

sudo update-alternatives --config editor

which gives this menu

$ sudo update-alternatives --config editor
There are 4 choices for the alternative editor (providing /usr/bin/editor).

  Selection    Path                Priority   Status
* 0            /bin/nano            40        auto mode
  1            /bin/ed             -100       manual mode
  2            /bin/nano            40        manual mode
  3            /usr/bin/vim.basic   30        manual mode
  4            /usr/bin/vim.tiny    10        manual mode

Press <enter> to keep the current choice[*], or type selection number:

note: vim is not there as an option

Im thinking digital ocean has not added the vim install to the update-alternatives system?
What is the recommended way to get the /user/bin/vim program added to this menu?
I guess I could overwrite the /usr/bin/editor symlink that the alternatives system adds or maybe add a symlink in /etc/alternatives pointing to /usr/bin/vim ? but I would like to try the "official" way before I do my "hack" on top of the digital ocean hack.


This is not modified, but the standard Ubuntu behaviour up to Zesty. If you do a ls -l on vim (/usr/bin/vim), you see that it is a link to /etc/alternatives/vim, which in turn links to /usr/bin/vim.basic.

Execution of vim --version or vim.basic --version also reveals that they are in fact the same full, "giant" vim version 8.0 without GUI.

To answer your question: Menu choice of vim.basic gives you the desired full vim version. It is just that the name is misleading.


First set your editor to the right path:

sudo update-alternatives --install /usr/bin/editor editor /usr/local/bin/vim && \
sudo update-alternatives --set editor /usr/local/bin/vim

Then aliases:

sudo update-alternatives --install /usr/bin/vi vi /usr/local/bin/vim 1 && \
sudo update-alternatives --set vi /usr/local/bin/vim

Don't forget the 1 near the end of the first line above.

  • This should be the accepted answer: it answers the question on how to add a custom editor to the alternatives – vanadium Jul 18 at 11:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.