Home Download Buy Blog Forum Support

ST3: disable snippets shipped by default

ST3: disable snippets shipped by default

Postby hubert on Thu Feb 07, 2013 12:22 pm

In Sublime Text 2 I was able to delete all the *.​sublime​-​snippet files for a package (in my case PHP) because they were just annoying to me.

This is not possible anymore in ST3 because the package resides within the PHP.sublime-package within the Sublime Text.app. Is there another way to disable snippets for a language?
hubert
 
Posts: 31
Joined: Mon Jan 09, 2012 12:12 pm

Re: ST3: disable snippets shipped by default

Postby hubert on Thu Feb 07, 2013 12:36 pm

I read up on the ST3 documentation, and it says
http://www.sublimetext.com/docs/3/packages.html
Overriding Files From a Zipped Package

To override a file in an existing package, just create a file with the same name under the Packages/<Package Name> directory.

For example to override the file function.sublime-snippet in the Python.sublime-package package that ships with Sublime Text, create a directory called Python under the <data_path>/Packages directory, and place your function.sublime-snippet file there.

If I create an empty file ~/Library/Application Support/Sublime Text 3/Packages/PHP/define(-).sublime-snippet ST3 crashes upon start. If I copy the snippet from the ZIP file and change the tab trigger to something else, now both the trigger I don't like in the first place and the new trigger work.
hubert
 
Posts: 31
Joined: Mon Jan 09, 2012 12:12 pm

Re: ST3: disable snippets shipped by default

Postby skuroda on Thu Feb 07, 2013 8:24 pm

Odd I just tried it (on my Windows machine) and it overrides the snippet fine. Mind posting your define(-).sublime-snippet file so I could test with yours?
skuroda
 
Posts: 390
Joined: Fri Oct 05, 2012 8:11 am

Re: ST3: disable snippets shipped by default

Postby hubert on Fri Feb 08, 2013 8:19 am

You are right, I now got it to work, it seems that I had another copy of the package in the folder. The quick solution for me now was to change the scope for each snippet to something that doesn't apply to PHP. Thanks!
hubert
 
Posts: 31
Joined: Mon Jan 09, 2012 12:12 pm

Re: ST3: disable snippets shipped by default

Postby ckizer on Tue Feb 19, 2013 2:08 pm

How can I get this to work on Mac? I cannot stand the default forced CSS snippets. Everytime I type tab twice it inserts "Windows"
ckizer
 
Posts: 19
Joined: Mon Mar 12, 2012 10:26 pm

Re: ST3: disable snippets shipped by default

Postby skuroda on Wed Feb 20, 2013 5:34 am

ckizer wrote:How can I get this to work on Mac? I cannot stand the default forced CSS snippets. Everytime I type tab twice it inserts "Windows"


You need to override the snippets. As hubert stated, you can change the scopes of the snippets so they are not triggered.
skuroda
 
Posts: 390
Joined: Fri Oct 05, 2012 8:11 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 15 guests