Hi,
I’m trying to set up context-sensitive key bindings, but I haven’t found anything relevant in the documentation, and I’m missing a necessary environment variable. An example would be the following, for the key binding super+b :
a) if some text is selected, it expands to \textbf{$SELECTION}$0
b) if no text is selected, it expands to \textbf{“adjWord”}$0, where “adjWord” is a name I made up for whatever word the cursor is currently adjacent to.
So far, I’ve only been able to do (a):
{ "keys": "super+b"], "command": "insert_snippet", "args": { "contents": "\\textbf{$SELECTION}$0" } }
So, I have two questions: 1) how do I set up a conditional statement? and 2) is there an environment variable that does what I’m using “adjWord” for above?
Cheers,
fort