Home Download Buy Blog Forum Support

Triggering Snippet with key combo

Triggering Snippet with key combo

Postby sublime_user on Thu Aug 11, 2011 7:25 pm

Hi,

How do I trigger a snippet when I hit do a key combo. For example, when I hit "CTRL+D" I want it to show this chunk of text:

# show hello world
print "hello world"

Thanks.
sublime_user
 
Posts: 13
Joined: Wed Aug 03, 2011 9:17 pm

Re: Triggering Snippet with key combo

Postby sublime_user on Fri Aug 19, 2011 3:06 pm

Anyone? Had to rename the thread topic name to make it more clear. Any help is greatly appreciated.

Thanks!
sublime_user
 
Posts: 13
Joined: Wed Aug 03, 2011 9:17 pm

Re: Triggering Snippet with key combo

Postby iamntz on Fri Aug 19, 2011 3:24 pm

This one should work:
Code: Select all
{ "keys": ["ctrl+d"], "command": "insert_snippet", "args": {"contents": "# show hello world\nprint \"hello world\""} }
iamntz
 
Posts: 917
Joined: Fri Apr 29, 2011 8:52 am
Location: Romania

Re: Triggering Snippet with key combo

Postby sublime_user on Fri Aug 19, 2011 8:12 pm

Thanks! This helped a lot.
sublime_user
 
Posts: 13
Joined: Wed Aug 03, 2011 9:17 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 18 guests