Sublime Text 2 as Default Editor in Ubuntu 12.04 8

Sublime Text is an awesome text editor. If you’ve never heard of it, you should go


Step 1

Download the tarfile that suits you best and extract it. Here’s the command to extract tar.bz2 files:

Step 2

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 :


Step 3

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:


Step 4

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”:


And paste the following content:

As you can see, these lines are quite straightforward. Go ahead and experiment a bit with them.

Step 5

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:


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

Enjoy !!

Goto :


8 thoughts on “Sublime Text 2 as Default Editor in Ubuntu 12.04

  1. Reply James Jun 4, 2013 7:46 pm

    Excellent guide – thanks very much! :)

  2. Reply Dhirendra Jun 27, 2013 10:37 am

    thanks. it worked without any glitch.

  3. Reply lonesword Aug 25, 2013 12:11 pm

    Saved me a lot of googling. Thanx :)

  4. Reply pierrot Oct 8, 2013 12:44 pm

    thanks so much :) easy tutorial, awesome result!

  5. Reply jimbo Dec 3, 2013 11:34 pm

    well done – thanks

  6. Reply Mikhail Dec 22, 2013 4:21 pm

    Thank you very much!

  7. Reply John Pray Jan 16, 2014 8:41 am

    If you installed Sublime Text 3 using the default Ubuntu installer, you can skip straight to Step 5 (editing defaults.list). Make sure to use “sublime-text.desktop” instead of “sublime.desktop”.

    Thanks for the article!

Leave a Reply