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: 681
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: 681
Joined: Fri Oct 05, 2012 8:11 am

Re: ST3: disable snippets shipped by default

Postby kirkstrobeck on Wed Oct 30, 2013 10:34 pm

Doesn't work when trying to override `value-of` on an xsl document. enter `val` and hit tab. There is nowhere this snippet is being added, therefore no way to alter/remove.
kirkstrobeck
 
Posts: 1
Joined: Wed Oct 30, 2013 10:33 pm

Re: ST3: disable snippets shipped by default

Postby skuroda on Thu Oct 31, 2013 5:13 am

I just tried it in ST3. I didn't get any snippet. I'd guess you have a plugin that is inserting the snippet, though I could be wrong.
skuroda
 
Posts: 681
Joined: Fri Oct 05, 2012 8:11 am

Re: ST3: disable snippets shipped by default

Postby Dreadatour on Thu Nov 14, 2013 11:53 pm

I have this problem too.

Wrote a simple script to disable all default snippets for Python language: https://gist.github.com/dreadatour/7475747 (OS X only).
This should work for another languages too. Hope this helps.

For Sublime Text author (if his reading this =): please, make the config option to disable default snippets. At least Python snippets are awful and annoying!
Dreadatour
 
Posts: 1
Joined: Thu Nov 14, 2013 11:46 pm

Re: ST3: disable snippets shipped by default

Postby ntenney on Sat Nov 16, 2013 2:17 am

Dreadatour wrote:I have this problem too.

For Sublime Text author (if his reading this =): please, make the config option to disable default snippets. At least Python snippets are awful and annoying!


Just out of curiosity, what problems do you have with the Python snippets? I've found them to be helpful, but I don't really use any beyond the class and function creation ones.
ntenney
 
Posts: 66
Joined: Thu May 03, 2012 9:10 pm


Return to General Discussion

Who is online

Users browsing this forum: jfcherng, Yahoo [Bot] and 26 guests