How to install Sublime Text 2 on Ubuntu 13.10

Most of the programmers out there have heared about Sublime Text 2.
This is a tutorial showing you how to install it on Ubuntu 13.10. Same steps will work on the previous versions of Ubuntu as well:

1. Download the Sublime Text2 file (.tar.bz2) from http://www.sublimetext.com/2

2. Extract the .tar.bz2 file:
tar xf Sublime\ Text\ 2.0.2\ x64.tar.bz2

3. You’ll get a “Sublime Text 2″ folder after extraction. This folder contains all the files that Sublime Text will need. So we have to move that folder somewhere more appropriate. Like the “/opt/” folder :
sudo mv Sublime\ Text\ 2 /opt/

 4. At some point you’d want to be able to call Sublime Text from the Terminal by just typing “sublime”. To do that, we’ll just create a symbolic link in “/usr/bin” like thus:
sudo ln -s /opt/Sublime\ Text\ 2/sublime_text /usr/bin/sublime

5. Now that our files are at the right place, we need to create a launcher in Unity. To do this, we’re going to create a .desktop file in “/usr/share/applications”:
sudo sublime /usr/share/applications/sublime.desktop

and paste this content:
[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


6. Now you would probably want to open all text files with Sublime Text 2. The easiest way to do that is to open up the file associations list:
sudo sublime /usr/share/applications/defaults.list

And replace all occurrences of gedit.desktop with sublime.desktop.

That's it. I hope you enjoyed it and here is a screenshot with the Sublime Text 2 application running on Ubuntu:

0 comentarii:

Post a Comment