Linux : How-To: Changing the default text editor

There is a few software that will use the editor command to find out what text editor to use. Example commands will be dch to add a new .deb changelog entry, revision control softwares when prompting for a commit message …

There is basically 2 ways for changing the default editor:

* System wide
* At user level

System Wide

Run:

kartook@Nilas:~$sudo update-alternatives –config editor

And then choose whichever editor you want to be default.

User Level

As a user, you cannot change the setting for the whole system, but you can add an alias for editor to let say vim.

Open and edit ~/.bashrc and add:

alias editor=vim

Next time you will open a bash prompt, your default editor will be vim.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.