7

I installed Sublime Text using this tutorial http://www.technoreply.com/how-to-install-sublime-text-2-on-ubuntu-12-04-unity/

I want to associate Sublime with css, js and php files. I added the following rows but still when double click on a php, js or css file, it does NOT open it at all (not just with Sublime):

text/php=sublime.desktop
text/x-php=sublime.desktop
application/php=sublime.desktop
application/x-php=sublime.desktop
application/x-httpd-php=sublime.desktop
application/x-httpd-php-source=sublime.desktop
text/javascript=sublime.desktop
text/css=sublime.desktop

How should I proceed?

2 Answers 2

3

This is how I changed the default editor for multiple file types in 12.04:

  1. Right click the file in question
  2. Choose 'Properties'
  3. Select the 'Open With' tab
  4. Choose 'Sublime Text' under 'Related' or 'Recommended' Applications
  5. Select 'Set as default' option on the bottom right

If Sublime Text doesn't show up on this list, make sure it's fully installed via the package manager.

Unfortunately I haven't found a way to do this in batch yet and a previous method of opening some hidden file and doing a find and replace for sublime text didn't work for me.

2

For Xubuntu. Don't know about Ubuntu or others.

I found this way. And without any command line typing, which is good.

  1. In "File Manager" right click on a file (e.g. file.conf) you want to be opened by Sublime Text 2 (or any other application).

  2. Choose "Properties". A window titled file.conf - Properties should appear.

  3. In its tab "General" click "Open With:" and then choose "Other Application...". A window titled Open With should appear.

  4. At the bottom of this window select "Use a custom command:" option and then "Browse...".

  5. Browse to the necessary executable, Sublime Text 2, for example.

The most important part now: before click Ok put the selected path into double quotes, e.g.:

"/opt/Sublime Text 2/sublime_text"

because otherwise it cannot accept the path .

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .