Manually Installing Sublime Text 2 On Ubuntu

Overview

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.

Install

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

Summary

How to install Sublime Text 2 on Ubuntu 12.04 (Unity)

How do I make Sublime Text 3 the default text editor [duplicate]

About Danny

I.T software professional always studying and applying the knowledge gained and one way of doing this is to blog. Danny also has participates in a part time project called Energy@Home [http://code.google.com/p/energyathome/] for monitoring energy usage on a premise. Dedicated to I.T since studying pure Information Technology since the age of 16, Danny Tsang working in the field that he has aimed for since leaving school. View all posts by Danny → This entry was posted in Linux, Software and tagged , , , , . Bookmark the permalink.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.