Hi All,
I’m getting familiar with writing custom key bindings.
I have the following snippet:
...
{ "keys": "ctrl+shift+d"],
"command": "insert_snippet",
"args": {
"contents": "console.log('=== $SELECTION $TM_FILENAME $TM_LINE_NUMBER] ===', $SELECTION);${0}"
},
"context": {
"key": "selector",
"operator": "equal",
"operand": "source.js",
"match_all": true
}]
}
...
It is a simple snippet insertion with a purpose to aid JS debugging. It allows me to select text (variable name, e.g. testvar) and using ctrl+shift+d converts it into:
console.log('=== testvar some_file.js [477] ===', testvar); // where 477 is a line number and some_file.js is the current js file I'm working in.
That works all fine and dandy.
What I’m trying to accomplish is to be able to pass clipboard content as an argument to insert_snippet. Is it possible to pass commands as arguments (paste in this case), or is there a different approach to accomplish this task? It would be nice to be able to use clipboard content instead of selection (or both if needed) somehow.
Any help is appreciated!