Remove default snippets


#1

Hi everyone!
I wrote my personal snippets in “snippets.cson” file but now there are duplicate. Is it possible to remove snippets from a pre-installed package (for example “Language-C”)?
Thank you for your attention. Have a nice day! :grin:


#2

Please share your snippets.cson and which snippets you’d like to override.


#3

I don’t want to override but I want to remove some default snippets. For example in language-c there’s cs prefix and in my own snippets.cson I added case prefix. Is it possible remove cs snippet?


#4

I found a solution!
I wrote in my own snippets.cson the old prefix without body and now it doesn’t show.


#5

You’re trying to override the default case snippet with your own. You just add an entry in snippets.cson with the same name as the snippet you want to override. The prefix doesn’t matter as far as I know.


#6

The original snippet is:
name: case
prefix: cs
body: Something
If I add in my own snippets.cson a snippet with the same name (case) and different prefix (case), if I write ‘c’ there are both options: cs and case.
So, I added a snippet called case without body and then I added my own snippet called case1 with case prefix. Now there’s only case option.
I don’t know if this is the correct way to do it, but it works :grinning:


#7

Sounds like a plan.