Linux Mint/Ubuntu: how to set Sublime Text 2 as default text editor

How to install and set Sublime Text 2 as the default text editor on Ubuntu or Linux Mint:

  1. Download from http://www.sublimetext.com/
  2. Unpack the downloaded file into your home directory (eg: /home/yourname/SublimeText2/)
  3. Open the file /home/yourname/.local/share/applications/defaults.list (create this file if it doesn’t exist)
  4. Create/edit the [Default Applications] section, with a text/plain entry for Sublime like:
    [Default Applications]
    text/plain=sublime2.desktop 
  5. Create the file /home/yourname/.local/share/applications/sublime2.desktop with this in it:
    [Desktop Entry]
    Version=1.0
    Type=Application
    Name=Sublime 2
    Exec=/home/yourname/SublimeText2/sublime_text
    Terminal=false
    Categories=Accessories
    StartupNotify=true
    MimeType=text/plain; 
  6. Done (you may need to logout and log back in)

1 thought on “Linux Mint/Ubuntu: how to set Sublime Text 2 as default text editor”

  1. Maya

    Very useful, thanks. You can also add some other MIME types (depending on your needs) to be opened by SublimeText in the same defaults.list.

    Reply ↓

Leave a Reply

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