Edit Sublime Text 2's default snippets
Asked Answered
P

2

31

I've been using Sublime text 2 for the past few days, and I have to say it's been amazing!

I have added many snippets already, but can't figure out how to edit Sublime's default snippets like the script element (script+tab).

In my opinion the script element shouldn't have a type attribute in HTML5, so I'd like to edit that snippet.

Problem is, I can't find it in the /Packages/User folder like the user defined snippets.

Any help would be appreciated!

Pigeontoed answered 28/3, 2012 at 23:20 Comment(0)
K
28

For this its in Packages/HTML/HTML.sublime-completions. To find this kind of stuff all you have to do is do a find anything (Ctrl+Shift+F on linux, don't know for mac..) then bung the sublime folder in the where field and search away!

Kordofan answered 29/3, 2012 at 23:29 Comment(5)
To avoid your changes being over-written by Sublime or package updates, copy the file to your Packages/User folder first, and edit that rather than the original.Valuer
@JeremyHalliwell - I tried doing that - but Sublime seems to still use the original default snippet?Maurita
On a Mac, the full path to the Packages folder is ~/Library/Application Support/Sublime Text 2/PackagesMathematics
The packages folder doesn't exist on Sublime Text 3. Do you know how to change this in ST3?Walters
Sorry, never its there, but it doesn't have the default packagesWalters
K
17

Mac Answer

Go in the menu:
Sublime Text 2 -> Preferences -> Browse Packages...
Than open the HTML folder.
Double click on html_completions.py
Search for script and edit the value.

Hope this help someone.

Kenji answered 12/9, 2013 at 14:5 Comment(2)
I've been looking for this for a long time, thank youMaryannamaryanne
wanted to delete a snippet I created, but couldn't find it anywhere. ThanksCohl

© 2022 - 2024 — McMap. All rights reserved.