Skip to content

Commit 95890de

Browse files
authored
Update docs to clarify that all actions require a target (#628)
1 parent 849d591 commit 95890de

File tree

3 files changed

+31
-29
lines changed

3 files changed

+31
-29
lines changed

cursorless-talon/src/cheatsheet/cheat_sheet.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,10 @@ def draw(self, canvas):
122122
),
123123
)
124124

125-
self.draw_section(canvas, "Special marks", get_list("special_mark"))
126-
127125
self.next_column(canvas)
128126

127+
self.draw_section(canvas, "Special marks", get_list("special_mark"))
128+
129129
self.draw_section(canvas, "Positions", get_list("position"))
130130

131131
self.draw_section(

cursorless-talon/src/cheatsheet/sections/actions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def get_actions():
1616
"rewrap",
1717
]
1818
simple_actions = {
19-
key: value
19+
f"{key} <T>": value
2020
for key, value in all_actions.items()
2121
if value not in multiple_target_action_names
2222
}

docs/user/README.md

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Note: If you'd like to customize any of the spoken forms, please see the [docume
5656

5757
## Overview
5858

59-
Every cursorless command consists of an action performed on a target. For example, the command `"chuck blue air"` deletes the token with a blue hat over the `"a"`. In this command, the action is `"chuck"` (delete), and the target is `"blue air"`.
59+
Every cursorless command consists of an action performed on a target. For example, the command `"chuck blue air"` deletes the token with a blue hat over the `"a"`. In this command, the action is `"chuck"` (delete), and the target is `"blue air"`. There are no actions without at least one target.
6060

6161
## Targets
6262

@@ -138,7 +138,7 @@ minimize syllables.
138138

139139
##### `"this"`
140140

141-
The word `"this"` can be used as a mark to refer to the current cursor(s) or selection(s). Note that when combined with a modifier, the `"this"` mark can be omitted, and it will be implied.
141+
The word `"this"` can be used as a mark to refer to the current cursor(s) or selection(s) as a target. Note that when combined with a modifier, the `"this"` mark can be omitted, and it will be implied.
142142

143143
- `chuck this`
144144
- `take this funk`
@@ -319,17 +319,17 @@ Selects both the token containing letter 'a' with a blue hat AND the token conta
319319

320320
## Actions
321321

322-
In any cursorless command the action defines what happens to the given target, for example deleting the target (`"chuck"`) or moving the cursor to select the target (`"take"`).
322+
In any cursorless command, the action defines what happens to the specified target. Every command must have a target. For example, deleting the target (`"chuck"`, as in `"chuck air"`) or moving the cursor to select the target (`"take"`, as in `"take air"`).
323323

324324
### Cursor movement
325325

326326
Despite the name cursorless, some of the most basic commands in cursorless are for moving the cursor.
327327

328328
Note that when combined with list targets, these commands will result in multiple cursors
329329

330-
- `"take"`: Selects the given target
331-
- `"pre"`: Places the cursor before the given target
332-
- `"post"`: Places the cursor after the given target
330+
- `"take <TARGET>"`: Selects the given target
331+
- `"pre <TARGET>"`: Places the cursor before the given target
332+
- `"post <TARGET>"`: Places the cursor after the given target
333333

334334
eg:
335335
`pre blue air`
@@ -339,7 +339,7 @@ Moves the cursor to before the token containing letter 'a' with a blue hat.
339339

340340
This command can be used to delete a target without moving the cursor
341341

342-
- `"chuck"`
342+
- `"chuck <TARGET>"`
343343

344344
eg:
345345
`chuck blue air`
@@ -349,20 +349,23 @@ Deletes the token containing letter 'a' with a blue hat.
349349

350350
This command will delete a target and leave the cursor where the target used to be, making it easy to change a target
351351

352-
- `"change"`
352+
- `"change <TARGET>"`
353+
eg:
354+
`change blue air`
355+
Deletes the token containing letter 'a' with a blue hat then places your cursor where the token had been.
353356

354357
### Cut / copy
355358

356-
- `"carve"`: cut
357-
- `"copy"`: copy
359+
- `"carve <TARGET>"`: cut
360+
- `"copy <TARGET>"`: copy
358361

359362
eg:
360363
`copy blue air`
361364
Copies the token containing letter 'a' with a blue hat.
362365

363366
### Swap
364367

365-
Swaps two targets. If the first target is omitted, it will refer to the current selection. If the targets are list targets they will be zipped together.
368+
Swaps two targets. If the first target is omitted, it will target the current selection. If the targets are list targets they will be zipped together.
366369

367370
- `"swap <TARGET 1> with <TARGET 2>"`
368371
- `"swap with <TARGET>"`
@@ -374,18 +377,18 @@ Swaps the given tokens.
374377

375378
### Insert empty lines
376379

377-
- `"drink"`: Inserts a new line above the current line, and moves the cursor to the newly created line
378-
- `"pour"`: Inserts a new line below the current line, and moves the cursor to the newly created line
380+
- `"drink <TARGET>"`: Inserts a new line above the target line, and moves the cursor to the newly created line
381+
- `"pour <TARGET>"`: Inserts a new line below the target line, and moves the cursor to the newly created line
379382

380383
eg:
381384
`pour blue air`
382385
Insert empty line below the token containing letter 'a' with a blue hat.
383386

384387
### Rename
385388

386-
Executes vscode rename action on the given target
389+
Executes vscode rename action on the specified target
387390

388-
- `"rename"`
391+
- `"rename <TARGET>"`
389392

390393
eg:
391394
`rename blue air`
@@ -395,9 +398,9 @@ Rename the token containing letter 'a' with a blue hat.
395398

396399
Scrolls a given target to the top, center or bottom of the screen.
397400

398-
- `"crown"`: top
399-
- `"center"`: center
400-
- `"bottom"`: bottom
401+
- `"crown <TARGET>"`: top
402+
- `"center <TARGET>"`: center
403+
- `"bottom <TARGET>"`: bottom
401404

402405
eg `crown blue air` scrolls the line containing the letter 'a' with a blue hat to the top of the screen.
403406

@@ -445,19 +448,19 @@ See [experimental documentation](experimental/wrapper-snippets.md).
445448

446449
### Show definition/reference/quick fix
447450

448-
- `"define"`
449-
- `"reference"`
450-
- `"hover"`
451-
- `"quick fix"`
451+
- `"define <TARGET>"`
452+
- `"reference <TARGET>"`
453+
- `"hover <TARGET>"`
454+
- `"quick fix <TARGET>"`
452455

453456
eg:
454457
`define blue air`
455458
Shows definition for the token containing letter 'a' with a blue hat.
456459

457460
### Fold/unfold
458461

459-
- `"fold"`
460-
- `"unfold"`
462+
- `"fold <TARGET>"`
463+
- `"unfold <TARGET>"`
461464

462465
eg:
463466
`fold funk blue air`
@@ -467,8 +470,7 @@ Fold the function with the token containing letter 'a' with a blue hat.
467470

468471
Extracts a target as a variable using the VSCode refactor action
469472

470-
- `"extract"`
471-
- `"extract {TARGET} as hello world"`
473+
- `"extract <TARGET>"`
472474

473475
eg:
474476
`extract call air`

0 commit comments

Comments
 (0)