How do I change the default text editor?
Here is what worked in my case:
- Right click on a text file.
- Choose "Properties" (not "Open With...")
- Click on the "Open With" tab.
- Choose your new text editor.
- 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
To change default text editor across the file types, try updating gnome-text-editor configuration.
sudo update-alternatives --config gnome-text-editor
In some cases:
sudo update-alternatives --config editor
A more robust solution would be to replace the bindings in /usr/share/applications/defaults.list
.
sed -i 's/gedit/emacs/' /usr/share/applications/defaults.list