Sublime is one of the best of the text editor I have used. One of the best things about it is that it’s cross platform but it doesn’t include an installer for Linux.
Download a copy of the Sublime Text program. This comes in a zipped format.
In the terminal go to the folder where the download is and extract it:
cd Downloads
tar xf Sublime\ Text\ 2.0.2\ x64.tar.bz2
Move it to a system folder so it’s accesssible to all users:
sudo mv Sublime\ Text\ 2 /opt/Sublime\ Text
Create symlink so that sublime can be started in the commandline with the word “sublime”:
sudo ln -s /opt/Sublime\ Text/sublime_text /usr/bin/sublime
Create a desktop file so that it can be accessed in the apps menu:
sudo sublime /usr/share/applications/sublime_text.desktop
Sublime should open a blank file. Copy and paste the following:
[Desktop Entry]
Version=1.0
Type=Application
Name=Sublime Text
GenericName=Text Editor
Comment=Sophisticated text editor for code, markup and prose
Exec=/opt/Sublime\ Text/sublime_text %F
Terminal=false
MimeType=text/plain;
Icon=sublime-text
Categories=TextEditor;Development;
StartupNotify=true
Actions=Window;Document;[Desktop Action Window]
Name=New Window
Exec=/opt/Sublime\ Text/sublime_text -n
OnlyShowIn=Unity;[Desktop Action Document]
Name=New File
Exec=/opt/Sublime\ Text/sublime_text –command new_file
OnlyShowIn=Unity;
To change gedit to sublime as the default editor, do a find and replace on /usr/share/applications/defaults.list and replace any gedit.desktop with sublime_text.desktop
E.g:
sudo sublime /usr/share/applications/defaults.list
How to install Sublime Text 2 on Ubuntu 12.04 (Unity)
How do I make Sublime Text 3 the default text editor [duplicate]