Snippets can be created directly inside Sublime by choosing Tools -> New Snippet...
. Read through the docs and the snippet reference for details.
Sublime Text 2 stores its packages in ~/Library/Application Support/Sublime Text 2/Packages
, with a subdirectory for each package. However, these directories (and the files within them) can be overwritten when a package is updated, so it's best to save your custom snippets in the Packages/User
directory. By using
<scope>source.go</scope>
in your snippet, it will only be active when you're editing Go files.