I know how to create snippets in VS Code but I simultaneously work with Sublime Text. However, I don't know how to create snippets in Sublime Text to python syntax, please help me to deal with it.
1 Answer
Creating snippets are as easy as VS Code. Just go to Tools -> Developer -> New Snippet
You can see xml file like this:
<snippet>
<content><![CDATA[
Hello, ${1:this} is a ${2:snippet}.
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>hello</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.python</scope>
</snippet>
- Edit parameter of to be a main content and tabTrigger to a hint.
- You can also set a language in (python is deafult)
- Finally, save this in Sublime folder with .sublime-snippet extention.
- Enjoy )
1 Comment
OdatNurd
As an addendum to your answer, as an extra note you can also optionally add in a
<description></description> pair to set a text description for what the snippet contains.