Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does this work? What does it do? #1

Open
roman-ku opened this issue Mar 25, 2017 · 1 comment
Open

How does this work? What does it do? #1

roman-ku opened this issue Mar 25, 2017 · 1 comment

Comments

@roman-ku
Copy link

Please provide usage instructions.

@xnmp
Copy link

xnmp commented May 29, 2017

I also have no idea how to add my own snippets after some searching.

Edit:

  1. Create a snippet, which looks something like this:
<snippet>
    <!-- Type `bracket` and hit tab to open a bracket with a closing comment. -->
    <!-- Type the class for the element you are styling and it is placed at the top and in the comment after the closing bracket -->
    <!-- Hit tab a second time to put your cursor into a beautifuly tabbed spot within the bracket -->
    <content><![CDATA[
${1:this} {
    $2
} // ${1:this}
]]></content>
    <!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
    <tabTrigger>bracket</tabTrigger>
    <!-- Optional: Set a scope to limit where the snippet will trigger -->
    <scope>source.scss</scope>
</snippet>
  1. save it as mysnippet.sublime-snippet in ~/.config/sublime-text-3/Packages/User

  2. add something like the following to your keybindings:

{ "keys": ["q","tab"], "command": "insert_snippet", "args": {"name": "Packages/User/mysnippet.sublime-snippet"}, "context":
        [
            { "key": "selector", "operator": "equal", "operand": "source.python" }
        ]
    },

Funny thing is that being a newbie, when I first installed sublime text I heard all about snippets, and I looked up some plugins, but didn't have any idea what they actually are until recently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants