How To: Set vim as your default editor for Linux

How To: Set vim as your default editor for Linux

This post will help you to start use vim as default editor.

Step 1: Install vim.

sudo apt-get update
sudo apt-get install vim

Step 2: configure vim.

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

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

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

If you did not find vim record in a previous list run next command

sudo update-alternatives --install /usr/bin/editor editor /usr/bin/vim 100

Software engineer and consultant

Leave a Reply

Your email address will not be published. Required fields are marked *

*