Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have recently installed Sublime text 2 and I must say it's one of the best text editors I've ever used or even seen in use.

So I managed to install everything and added to the unity menu and also change all the entries of gedit.desktop to sublime.desktop and it works just fine for most files, but I realised that some files still open in gedit, for example PHP files. I checked the default list for PHP, but there isn't anything in there.

How would I set the default for opening PHP files?


Also, Sublime doesn't show up in them properties menu where I can usually select the default program.

I'm using Ubuntu 12.10.

share|improve this question
2  
possible duplicate of Change all associations from gedit to another application –  hhlp Oct 26 '12 at 11:02
add comment

4 Answers

up vote 5 down vote accepted

I think you didn't install the Sublime package via PPA. You might have downloaded the source.

Here is the steps to install the Sublime package via PPA

sudo add-apt-repository ppa:webupd8team/sublime-text-2
sudo apt-get update

sudo apt-get remove sublime-text*
sudo apt-get install sublime-text

After installing this Right Click on any php file now you will be able to see "Open with Sublime Text 2" or choose "Open with Other Application" and select "Sublime" from the list.

Hope this helps.

share|improve this answer
    
Hey, i think that is the case. Have to questions for you now. First of all how to you find the PPAs? i researched how to install sublime and nothing about it came up. Secondly i have run the first three steps you gave me, when i get to remove it selects packages but doesn't remove them because they're not there, so this means the sublime i installed myself is still on my system, how would i remove that? Thanks for the help. –  ragebunny Oct 26 '12 at 10:39
    
It's okay i've sorted that now, i just reverse engineered what i did to install it. –  ragebunny Oct 26 '12 at 10:52
add comment

left click on a file go to preferences and change the entry in open With

I hope that helps

share|improve this answer
1  
I have tried that but sublime doesn't show up in the list of application. However it does show up when i right click > open with menu. but i can't find it to to set it as default. –  ragebunny Oct 26 '12 at 10:04
add comment

Actually, you need to create a *.desktop file for this

Refer to this post: http://theodorbiryukov.blogspot.in/2012/04/ubuntu-sublime-text-2-as-default-text.html

share|improve this answer
add comment

Another option is to edit file association in this file: /usr/share/applications/defaults.list

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.