Ubuntu – How to change the default text editor

default-programs

How can I change my default text editor from gedit to Emacs?

Best Answer

Here is what worked in my case:

  1. Right click on a text file.
  2. Choose "Properties" (not "Open With...")
  3. Click on the "Open With" tab.
  4. Choose your new text editor.
  5. Mark chosen text editor using a button "Set as default".

This also works on 12.04 and 13.04.

@ Edit: based on comments it does work on all distros until 20.04