Debian/Ubuntu Tips and Tricks

Debuntu

Debian/Ubuntu Tips and Tricks

How-To: Changing the default text editor

Posted by chantra on September 16th, 2009

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

1. System Wide

Run:

$ sudo update-alternatives --config editor

And then choose whichever editor you want to be default.

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

Hope that helps!

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>