Skip to content

Commit 37ba96e

Browse files
Added note
1 parent 97bf1d6 commit 37ba96e

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

packages/cursorless-org-docs/src/docs/user/customization.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,3 +204,36 @@ _You can disable the default Cursorless reformat command by prefixing the spoken
204204
<user.formatters> form <user.cursorless_target>:
205205
user.cursorless_reformat(cursorless_target, formatters)
206206
```
207+
208+
### Experimental custom command action
209+
210+
_NOTE that this feature is experimental. Not as thoroughly tested as the rest of Cursorless and might change in the future_
211+
212+
`user.cursorless_custom_command(command: string, *args)`
213+
214+
Run a custom Cursorless command by parsing the specified command string.
215+
216+
- Utilizes default Cursorless spoken forms in the command string.
217+
- Optional target arguments can be interpolated in the command string.
218+
219+
#### Examples
220+
221+
`"scratch"` => `"chuck block"`
222+
223+
```talon
224+
scratch: user.cursorless_custom_command("chuck block")
225+
```
226+
227+
`"scratch air"` => `"chuck block air"`
228+
229+
```talon
230+
scratch <user.cursorless_target>:
231+
user.cursorless_custom_command("chuck block <target>", cursorless_target)
232+
```
233+
234+
`"combine air plus bat"` => `"bring block air after bat"`
235+
236+
```talon
237+
combine <user.cursorless_target> plus <user.cursorless_target>:
238+
user.cursorless_custom_command("bring block <target1> after <target2>", cursorless_target_1, cursorless_target_2)
239+
```

0 commit comments

Comments
 (0)