/usr/share/applications/defaults.list in Sublime:
sudo subl /usr/share/applications/defaults.list
Search for all instances of
gedit and replace them with
sublime_text. Save the file, quit Sublime, log out and back in, and you should be all set.
While the above instructions should work with any
.deb-based system (I use Ubuntu), apparently there is an issue with Mint where changes to
/usr/share/applications/defaults.list are lost upon reboot. To work around this, do the following:
- Create a new file (if it doesn't already exist) called
~/.local/share/applications/defaults.list in Sublime. The first line should be
/usr/share/applications/defaults.list in Sublime. Hit CtrlF to open the
Find dialog and type
gedit into the search box.
- Hit AltEnter or click the
Find All button to select all the instances of
gedit in the file.
- Hit CtrlL to expand the selections to the entire line, then hit CtrlC to copy the lines.
~/.local/share/applications/defaults.list, hit CtrlV to paste the lines containing
- Hit CtrlH to open the
Replace dialog. Search for
gedit and replace with
sublime_text. Hit CtrlAltEnter to Replace All (or click the
Replace All button) and you're all set.
~/.local/share/applications/defaults.list, log out and back in, and Sublime Text should now be your default text editor.