File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -13,3 +13,36 @@ To replace a target with the contents of the clipboard, say `"paste to <target>"
1313` "to <target>" ` is an example of a Destination. See [ Destinations] ( reference/destinations.md ) for more information.
1414
1515:::
16+
17+ ## How do I run a VSCode task / bash shell command on a target?
18+
19+ 1 . Add a [ VSCode task] ( https://code.visualstudio.com/docs/editor/variables-reference ) to your ` tasks.json ` (say ` "please open tasks" ` ):
20+
21+ ``` json
22+ {
23+ "label" : " Echo" ,
24+ "type" : " shell" ,
25+ "command" : " echo" ,
26+ "args" : [" ${selectedText}" ]
27+ }
28+ ```
29+
30+ (replace ` echo ` / ` Echo ` with your actual command name)
31+
32+ 2 . Add a spoken form to your ` vscode.talon ` :
33+
34+ ``` talon
35+ echo <user.cursorless_target>:
36+ user.cursorless_command("setSelection", cursorless_target)
37+ user.run_rpc_command("workbench.action.tasks.runTask", "Echo")
38+ ```
39+
40+ (replace ` echo ` / ` Echo ` with your actual command name)
41+
42+ You can now say eg ` "echo air past bat" ` .
43+
44+ ::: info
45+
46+ See the [ Talon-side api docs] ( ./customization.md#cursorless-public-api ) for more on creating custom Cursorless commands
47+
48+ :::
You can’t perform that action at this time.
0 commit comments