Sublime Forum

Syntax Specific Key Binding

#1

I see that there is no syntax specific key binding in the preference choice…

But can I specify syntax selector in key binding?

Say, can I do something like

"keys": "tab"], "command": "bullet_indent", "context":

{
"key": "selector", "operator": "equal", "operand": "source.markdown"
}
]

So that the key is only bind when the file opened is a markdown file?

0 Likes

[SOLVED] Key bindings from LaTeXing package always active
#2

You’re pretty close. I think the following should work:

(I wrapped it up in squiggly brackets and a comma,with the assumption that it’s not the last binding in the file; I also modified the scope.)

You can also use more specific scopes, such as “meta.paragraph.list.markdown” or “markup.list.unnumbered.markdown”. (I use the ScopeHunter plugin to determine scopes.)

Alex

0 Likes

#3

oh thanks soooooo much!!!

actually I didn’t make mistake in the text.html.markdown part (I type it wrong when I post in the forum)

But I screw up the braces =_=…

Thanks for telling me that it works so that I didn’t give up and think that Sublime Text do not allow me to do it…:stuck_out_tongue:

0 Likes