Skip to content

Instantly share code, notes, and snippets.

@raykao
Last active April 28, 2018 13:07
Show Gist options
  • Save raykao/7220710 to your computer and use it in GitHub Desktop.
Save raykao/7220710 to your computer and use it in GitHub Desktop.
How to add sublime as the default editor on Ubuntu
sudo mv Sublime\ Text\ 2 /opt/
sudo ln -s /opt/Sublime\ Text\ 2/sublime_text /usr/bin/sublime
sudo sublime /usr/share/applications/sublime.desktop

Copy/Paste to file

[Desktop Entry]
Version=1.0
Name=Sublime Text 2
# Only KDE 4 seems to use GenericName, so we reuse the KDE strings.
# From Ubuntu's language-pack-kde-XX-base packages, version 9.04-20090413.
GenericName=Text Editor

Exec=sublime
Terminal=false
Icon=/opt/Sublime Text 2/Icon/48x48/sublime_text.png
Type=Application
Categories=TextEditor;IDE;Development
X-Ayatana-Desktop-Shortcuts=NewWindow

[NewWindow Shortcut Group]
Name=New Window
Exec=sublime -n
TargetEnvironment=Unity
sudo sublime /usr/share/applications/defaults.list

Change all instances of gnome.desktop to sublime.desktop to make sublime default text editor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment