How to set default editor in 13.04? [duplicate]

Solution 1:

Try this. Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

sudo update-alternatives --config editor 

When it comes up choose your editor. See image below.

enter image description here

Solution 2:

This is how you set default applications..

Point and click:

Right click on the text file you want to open, choose Properties and then Open with. You should find Emacs in the Recommanded Software list. Click the Set as default button.

Using the commandline:

If you want to set default applications using the terminal, you use to XDG tool.

xdg-mime default emacs23.desktop text/plain

Then try to open a plain text document.

If you want to set default applications for the current user, edit this file:

~/.local/share/applications/mimeapps.list

To edit global settings by hand, see this file:

/usr/share/applications/default.list

Edit: Thanks to Oli how made me aware of XDG in the comments below the question

Solution 3:

I have already asked a similar question about changing all the associations for Gedit to Sublime Text (another GUI editor).

That's essentially where you answer lies except instead of using a .desktop file for Sublime Text, you'll be adding one (if one doesn't exist) for Emacs and then just changing all the associations to that.