0

I had some trouble figuring out how to add a Key Binding to my new Snippet in Sublime.

This answer may save some people some time...

1 Answer 1

0

As usual for key bindings go to Preferences -> Key Bindings

[
    { "keys": ["alt+d"], "command": "insert_snippet", "args": {"name": "Packages/User/myFirst.sublime-snippet"} },
    { "keys": ["ctrl+shift+d"], "command": "insert_snippet", "args": {"name": "Packages/User/mySecond.sublime-snippet"} },
    { "keys": ["alt+m"],"command": "open_markdown_preview" },
    { "keys": ["ctrl+shift+t"], "command": "open_terminal" }
]

The command insert_snippet is NOT the name of your snippet. It's command that tells Sublime to go look at the file you have named in the args.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.