Reputation: 8685
In Sublime Text 3, how do I edit my pre-existing snippet files? Is there a way of doing this within ST?
At the time of writing, there doesn't seem to be a straightforward answer to this anywhere on the web.
Upvotes: 58
Views: 30455
Reputation: 31
Tools -> Developer -> View package file -> search for the existing snippet. Change and save.
Upvotes: 3
Reputation: 1328
If someone (like me) is looking to edit a custom snippet:
open file *.sublime-snippet
which exists in
[home_directory]/.config/sublime-text-3/Packages/User/
If you have another file organization:
Upvotes: 3
Reputation: 8406
Here is how to edit built-in snippets manually on macOS, in this case the JavaScript snippets. This is a way to do it without installing plugins:
JavaScript.sublime-package
file to ~/Library/Application Support/Sublime Text 3/Installed Packages
JavaScript.sublime-package
to JavaScript.zip
and unzip the fileJavaScript
folder as required (e.g. delete the fun
snippet from the Snippets folder)JavaScript
folder again, rename it from JavaScript.zip
to JavaScript.sublime-package
and leave it in the Installed Packages
folder.Upvotes: 0
Reputation: 58652
For those of you that like a visual instruction here it is:
Then, you can find your snippet like this:
Upvotes: 60
Reputation: 3775
Custom snippets are saved in a .sublime-snippet
file that you create when you first save the snippet.
By default, these are placed in the "User" package. You can either browse to the file like you would any other file, or using PackageResourceViewer: Open Resource
-> User
-> [name of your snippet file]
Upvotes: 75
Reputation: 2266
Here are the steps I had to follow (figure out on my own) for anyone else who wants to edit the built-in snippets of Sublime (in my case Javascript's "fun" "function" snippet). Note: this assumes you've installed the Package "PackageResourceViewer" already:
WAY too complicated IMHO but at least it works.
Upvotes: 1