Installing Sublime Text 2 on Ubuntu (Update)

Sublime Text 2

Well it’s been quite some time since my last blog post. I’ve been really busy with a lot of stuff as well as going on holiday 🙂

Anyway this week I thought I would install Ubuntu and try and get some apps setup that I just can’t live without. One of the programs that I have been using a lot recently and really really love is Sublime Text 2. If you haven’t tried it yet, you should. It really makes my programming life easier. Plus, it’s multi-platform so you can install it on Mac, Windows and Linux.

Although this tutorial is specifically for Ubuntu users, almost all of it can be used on both Mac and Windows too.

Step 1 : Download it (DUH!)

Since I like to keep my programs on the cutting edge, I suggest downloading the latest dev build of Sublime Text 2. Either grab the 32 bit or 64 bit version for Linux depending on your current system.

Step 2 : Extract it

Once it has downloaded you can either extract it using the terminal or just use the Archive Manager that is built into Ubuntu. I just used the Archive Manager to extract it into a folder in my home directory called Applications. And now you’re basically done. Just go into the Applications/Sublime Text 2 folder and double click on sublime_text. If you prefer to run things via the console then cd into the Sublime Text 2 folder and run

Create a symlink

Now this is one part that I was having some troubles doing. The way that many people said to put the link to it into /usr/bin. However I found that I needed to create the link in /user/local/bin. Open terminal and enter the following:

You can make the name of the link almost anything you want really. So instead of subl you could call it slime or sublime.

Once this link has been created you should now be able to open sublime text via the terminal by just typing:

This will open sublime text. If you want it to open with the current directory you are in just add a space and a dot at the end.

The awesomeness doesn’t stop there!

To add to the awesomeness that is Sublime Text download and install Will Bond’s Sublime Package Control. The easiest way to install it is by opening the console in Sublime Text and running this command:

After it has installed close and reopen Sublime Text and now your can press ctrl + shift + p  and you can now start installing some awesome packages by typing install and pressing enter. This will load the latest list of packages available.

The first one I suggest installing is called Fetch which is brought out by nettuts. Fetch will help you download either single files or an entire package such as html5boilerplate. You can add pretty much any file you like.

Another great one that I have been using is Prefixr. Prefixr helps you add the the browser prefixes to your css. So, for example, you just need to type border-radius, run it through Prefixr, and it will add all the browser prefixes such as -moz and -webkit.

After some great comments on this post I thought I would add an update to include how to add a destop/launcher icon.

Adding a launcher/desktop icon

Create a new file on the desktop called sublime.desktop. You could create this file with Sublime Text if you like.
If you don’t have it open already, open it in Sublime Text and add the following lines to it.

If you are using a different command to open Sublime Text then the one I have been using in this tutorial you can update it in the part that says Exec=subl. Download a nice icon for Sublime Text like this one, and add the path to it in the file here Icon=/path/to/icon. Save the file and drag it into your launcher.

And there you have it! Not only can you do a quick launch from the terminal, but you also have a nice user friendly launcher to open Sublime Text 2.

Your thoughts

Have you tried sublime text yet? Do you have any other packages to suggest? Let me know in the comments.

22 thoughts on Installing Sublime Text 2 on Ubuntu (Update)

  1. I prefer the PPA version as well – easier to deal with, albeit updates can be a day or so behind official ones, so the app bothers you for no reason.

  2. Pingback: Install Sublime Text Manually in Ubuntu / Debian | All Medicated Geniuses

Leave a Reply

Your email address will not be published. Required fields are marked *