-
-
Notifications
You must be signed in to change notification settings - Fork 84
intro doc WIP with some concepts and a few example walk throughs #1538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice start! I left some comments inline
docs/user/intro.md
Outdated
Commands have an action and a target or two. `"chuck air"` has the action `"chuck"` and one target (the `"air"` token). | ||
`"bring air to bat"` has the action `"bring"` and two targets (the `"air"` and `"bat"` tokens). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is the user supposed to be in there user journey when they arrive here? If this is supposed to be one of the first things they see, then they almost certainly won't know what "the "air"
token" means
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent question. From our group talk, I think we all agreed on this being a Part 2 of a three part series.
- Basic. Try to get people to understand "take air", "chuck row 33" and probably highlight the most useful actions.
- THIS DOC, intermediate. Getting people beyond the very basics, to start using chained modifiers and understanding the underlying structure of cursorless. Highlight the most useful modifiers and combinations of concepts.
- Advanced. At the least, will include: snippets, pairs (if I didn't cover them in part 2), every, instance, just.
docs/user/intro.md
Outdated
A target can even be a vertical slice or list, like the list `"air and bat"`. | ||
Doing `"take air and bat"` will result in multiple selections and multiple cursors, but it is still one target. | ||
|
||
Commands with two targets often require a separator word between the two targets, like the `"to"` in `"move air to bat"`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not entirely accurate to call "to"
a separator word. It actually turns "bat"
into a destination. The "move"
action expects a destination for its second argument. The words "to"
, "after"
, and "before"
are the three ways to turn a target into a destination
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will work on how best to introduce the concept of destination. Thanks.
docs/user/intro.md
Outdated
Commands with two targets often require a separator word between the two targets, like the `"to"` in `"move air to bat"`. | ||
The separator may seem trivial now, but it is easier to forget it when you start using fancy targets. | ||
|
||
### Targets Can Be Modified |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpicking here, but I prefer just capitalizing the first word of section headings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I can play nice with that.
docs/user/intro.md
Outdated
|
||
### Targets Can Be Modified | ||
|
||
A target starts as a mark (`"this"`, `"row ten"`, `"green curve air"`, etc) and target modifiers can be applied to suit your needs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"starts" is a bit confusing here. It's true that the pipeline logically emanates from a mark, but it is actually the last word you'll say when naming a target
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll make it more clear. Perhaps: "A target contains a mark and target modifiers can be prefixed to suit your needs."
docs/user/intro.md
Outdated
`"chuck just bat"` will not delete any spaces; the `"just"` causes the command to ignore delimiters. | ||
`"take just just just bat"` does the same as `"take bat"`. | ||
|
||
Special positional target modifiers `"before"` and `"after"` try to work with delimiters. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as mentioned elsewhere, I'm hesitant to add more of the old language around "positional target modifiers". These are required words to form a destination
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll have to rewrite this once I write up the earlier stuff about destinations.
docs/user/intro.md
Outdated
Special positional target modifiers `"start of"` and `"end of"` do not use delimiters. | ||
`"bring line to end of row ten"` will bring a copy of the current line content _without line delimiter_ to the end of line 10, meaning line 10 will get content added to it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm not sure how important this is to learn at the start. and you'd likely be better served saying "bring line after last token row ten" anyway so that you get a space
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it is much extra mental burden to know that "before" and "after" have counterparts that don't use delimiters. I think this is the best time to introduce it. I wouldn't get too focused on the practicality of that exact example. I have asked for slack-help on how to do something and got answers with "start of". Maybe was a quirk of how I learned things, but things really clicked when I learned about all four positional "modifiers"; it felt like a small thing with a big impact.
docs/user/intro.md
Outdated
- `"bring T1 [to T2]"`: replace selection/T2 with T | ||
- `"move T1 [to T2]"` | ||
- `"chuck T"`: delete T | ||
- `"change T"`: delete T and set cursor(s) to where T was |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
given all the discussion of delimiters above, it might be worth indicating here or somewhere that "change"
doesn't remove delimiters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, maybe it is chuck
that should be changed to say that it will delete appropriate delimiters as well.
docs/user/intro.md
Outdated
- `"drink/pour T"`: edit new line before/after T | ||
- Selection Manipulation | ||
- `"take T"`: set selection | ||
- `"give T"`: deselect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder how common this one is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
give
? Not that common, I guess. I think it originally got into my notes because it felt important at the time. Sometimes I wanted to not have a selection because of its interactions with search stuff. BUT, give this
doesn't even work for that. I now use "pre this" or something like "go left". I think I'll delete give
from the list.
docs/user/intro.md
Outdated
- `"give T"`: deselect | ||
- `"pre/post T"`: set selection before/after T | ||
- Clipboard | ||
- `"paste to T"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to include "paste before"
/ "paste after"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! I even want to add it to the cheatsheet.
Co-authored-by: Pokey Rule <[email protected]>
Co-authored-by: Pokey Rule <[email protected]>
docs/user/intro.md
Outdated
The big difference between a simple command `"bring air to bat"` and the intimidating `"bring next three tokens air to after just line bat"` is the addition of target modifiers. | ||
Target modifiers are often chained. `"after just line"` is a chain of three modifiers and they are applied in reverse order (`"line"`, then `"just"`, then `"after"`). | ||
The biggest difference between the simple `"bring air to bat"` and the intimidating `"bring next three lines air to tail block bat"` is the addition of target modifiers. | ||
Target modifiers are often chained. `"tail block"` is a chain of two modifiers and they are applied in reverse order (`"block"`, then `"tail"`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"tail block"
is actually a single modifier 😅. It extends its input past the end of its containing block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're looking for an intimidating command with a big fancy chain, maybe grab one from one of my videos? eg https://youtu.be/xtOkYdwUves ("move line every instance square plex after file"
). Tho keep in mind in that example the second target (the destination "after file"
) doesn't actually have an explicit mark; it's using the implicit "just this"
mark
But the source does break down as a nice long chain. Reading from right to left, it's:
- plex
- square ("box" in default parlance)
- every instance
- line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was hoping to have an example that would be fully explained by the current document; "every instance" is going to be in the next document. I can just change to "block func".
docs/user/intro.md
Outdated
Target modifiers are often chained. `"tail block"` is a chain of two modifiers and they are applied in reverse order (`"block"`, then `"tail"`). | ||
|
||
Modifier chains can be applied to each [primitive target](README.md#primitive-targets) in a [compound target](README.md#compound-targets). | ||
For instance, `"take tail line air and head block bat"` has chain `"tail line"` applied to `"air"` and chain `"head block"` applied to `"bat"`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as above, neither of these are really "chains": they're each a single modifier
docs/user/intro.md
Outdated
Targets are converted into destinations using a destination converter (`"to"`, `"before"`, `"after"`); that is why you have to say commands like `"bring air to bat"` or `"bring air before bat"`. | ||
The `"to"` might seem like cursorless is trying to resemble a sentence, but `"to"` actually serves a technical purpose of explicitly converting to a destination. | ||
|
||
Your destinations should start with a single destination converter before you add modifiers and/or a mark. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be worth having examples for "paste" / maybe "snippet"
docs/user/intro.md
Outdated
|
||
### Targets Sometimes Include Their Delimiter Depending On The Action And Modifiers | ||
Commands like `"paste"`, `"bring"`, and `"move"` have a target that is a destination. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prob worth pointing out htat for bring and move the second arg is destination: first is regular target
just wanted to check that this isn't blocked on anything from me? |
Co-authored-by: Pokey Rule <[email protected]>
Co-authored-by: Pokey Rule <[email protected]>
I feel like I should have had more examples, but some of them should go in the advanced guide and this should be a good enough start anyway. Feel free to choose a better filename. guide-intermediate.md? |
Some notes from talking with @josharian ... Agreed and fairly straightforward:
Jacob will think about:
Controversy!
Stuff to remember for when we have more than one guide doc
|
@pokey I think it is ready for you to look again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did a quick pass through the first quarter of this doc. Some great stuff here; left a bunch of minor comments
docs/user/guide-intermediate.md
Outdated
|
||
This document will try to: | ||
|
||
- Highlight the most useful actions and modifiers in Cursorless so you know which ones to focus on learning first. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If intermediate, then not sure "learning first" is the right term?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me, "getting to beginner level in cursorless" is pretty shallow. It's understanding hats, this, and a few commands. You don't know all the commands nor do you know which ones are important. Intermediate users at least roughly know which commands they should know. That is actually significant knowledge. You might be surprised how long people limp along with a very small number of commands while knowing they should learn more.
|
||
- Highlight the most useful actions and modifiers in Cursorless so you know which ones to focus on learning first. | ||
- Bring together a few important concepts that underlie a lot of Cursorless behavior. | ||
- Walk through some example editing operations that are common but perhaps tricky to a beginner. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If intermediate, should we use "beginner" here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The examples are tricky to a beginner who hasn't internalized the stuff in this doc. They won't be nearly so tricky once you are fully intermediate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Partially based on Jan Wessling saying that the doc comes across as not for beginners...
Highlight the actions and modifiers in Cursorless that the pros use most
That makes it sound like the guide is not for people who are currently beginners. "Highlight the most useful actions and modifiers in Cursorless so you know which ones to focus on learning first" is our intent.
Starting to feel comfortable with the basics?
I would say this guide is not for people who would described themselves as feeling comfortable, even if it is qualified "with the basics".
How about "Do you understand the very basics of how say a command that uses a hat?" instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's change title to "Getting comfortable with Cursorless" and make no mention of the word "intermediate" unless we are explicitly saying the guide is to help beginners get to intermediate.
docs/user/guide-intermediate.md
Outdated
- `"take T"`: set selection. | ||
- `"pre/post T"`: set selection before/after T. | ||
- Clipboard | ||
- `"paste to/before/after T"`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe separate this one into "paste to" vs "paste before/after", as you've done with "bring", and add the same note about inserting delimiters?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, right; this used to be below bring
, so I didn't bother. I will give it the "bring" treatment.
docs/user/guide-intermediate.md
Outdated
- `"bring T1 to T2"`: replace T2 with T. | ||
- `"bring T1 before/after T2"`: insert a copy of T1 before/after T2, including appropriate delimiters. | ||
- `"move T1 [to/before/after T2]"`: like `"bring"`, but moves instead of copies. | ||
- `"chuck T"`: delete T and appropriate delimiter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to link from "appropriate delimiter" to a deeper discussion with examples?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I will link to the "Delimiters" section.
- `"arg"` and `"item"`: often used to involve commas, like `"chuck item air"` or `"bring air after arg bat"` that take care of commas. | ||
- `"funk"` for function. | ||
- `"state"` for statement (which might span multiple lines or only part of a line). | ||
- Other modifiers that are like syntactic scopes in that they expand the target. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Other modifiers that are like syntactic scopes in that they expand the target. |
docs/user/guide-intermediate.md
Outdated
- `"[number] [scope]s"`, like `"chuck three lines row 12"` to delete rows 12-14. | ||
- `"[number] [scope]s backward"`, like `"chuck three lines backward row 12"` to delete rows 10-12. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would lean towards using "air"
instead of "row 12"
here, per discussion on Discord, but not opposed to keeping this to give some variety.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will change "chuck three lines row 12"
to "chuck three lines air"
to demonstrate you do not have to supply a line oriented target to n lines
.
### Command structure | ||
|
||
Commands have an action and a target or two. `"chuck air"` has the action `"chuck"` and one target (the `"air"` token). | ||
`"bring air to bat"` has the action `"bring"` and two targets (the `"air"` and `"bat"` tokens). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case "bring"
actually accepts a target and a destination. "to bat"
is a destination. Not sure if it's better to be slightly wrong here tho
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought destinations were a special kind of target.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not how we're viewing them today, but I wouldn't say that's wildly inaccurate, and I won't rule out the possibility we'll view them that way at some point in the future 😅. @AndreasArvidsson any opinion on this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since a destination is only a wrapper around the target it's not that inaccurate.
air
= target
to
= insertion mode
to air
= destination
I have definitely referred to destinations as targets sometimes. That said I'm not sure if it's a good habit or not :D
|
||
A target can be more than a single token or line. A target can be a [range](README.md#range-targets), like `"air past bat"` that spans from the `"air"` token to the `"bat"` token, and that is still considered _one_ target. | ||
A target can even be a vertical slice or list, like the list `"air and bat"`. | ||
Doing `"take air and bat"` will result in multiple selections and multiple cursors, but it is still one target. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do wonder how important this distinction is. We're actually not even consistent on this point internally. When the command comes from Talon to VSCode, it comes across as a single logical target, but after running our target pipeline, we call each output a target
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These statements were helpful to my understanding when I internalized them. It also helps when reading the reference or talking to other people.
Co-authored-by: Pokey Rule <[email protected]>
Co-authored-by: Pokey Rule <[email protected]>
Co-authored-by: Pokey Rule <[email protected]>
Co-authored-by: Pokey Rule <[email protected]>
|
||
- Words in square braces (`[]`) are optional, eg `hello [world]` means you can say `"hello"` or `"hello world"`. | ||
- Slashes (`/`) show alternatives. For example, `hello/world` means you can say `"hello"` or `"world"`. | ||
- Targets are represented by `T` with a possible digit, eg `T` or `T1` or `T2`. For example, `bring T1 to T2` means you can say `"bring air to bat"`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to include examples in this section? I like the idea of being example-heavy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Examples of what?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you mean examples of the [T/T1/T2]
syntax, what you have seems good.
fixed bug
I'm semi-back from other stuff. I think you last mentioned about breaking the PR into smaller chunks, and it makes sense for the author to do it as they work, but since I am no longer adding stuff, you have all the info I have for however you want to merge it in. I don't know what chunking you would find most helpful. |
Shall we close this now that it has its own home? We can start to integrate pieces of your guide into the official docs as we move forward |
Sounds good to me. |
I'll put in a lot more links once we start firming up the content. Feel free to suggest big changes.