Home Download Buy Blog Forum Support

Snippet Trigger

Snippet Trigger

Postby gnal on Fri Sep 30, 2011 1:56 pm

Is it possible to bind something else than tab to trigger a snippet :?:

For example, I want to bind alt+shift+h to trigger this:

Code: Select all
<h$1>${0:$TM_SELECTED_TEXT}</h$1>
gnal
 
Posts: 4
Joined: Fri Sep 30, 2011 1:25 pm

Re: Snippet Trigger

Postby grayrest on Fri Sep 30, 2011 2:54 pm

Code: Select all
    { "keys": ["alt+shift+h"], "command": "insert_snippet", "args": {"contents": "<h$1>${0:$TM_SELECTED_TEXT}</h$1>"} }


See the default keys for examples of invoking snippets from a snippet file.
grayrest
 
Posts: 12
Joined: Thu Sep 29, 2011 5:03 pm

Re: Snippet Trigger

Postby gnal on Fri Sep 30, 2011 3:30 pm

Thank you grayrest.
I am now satiated. Thanks to Sublime the awesome text editor :D
gnal
 
Posts: 4
Joined: Fri Sep 30, 2011 1:25 pm

Re: Snippet Trigger

Postby sfranky on Fri Sep 30, 2011 7:54 pm

thanks to both, that was really useful !!!
sfranky
 
Posts: 96
Joined: Mon Oct 19, 2009 10:06 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 31 guests