-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Add progressive increment across multiple cursors to the tutor #10821
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
base: master
Are you sure you want to change the base?
Add progressive increment across multiple cursors to the tutor #10821
Conversation
related: #9040 |
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.
We should keep the notation that we use for key combinations consistent: in other places in the tutor like section 7.4 we use Ctrl-a
rather than c-a
as you have here.
In the long run I'd like to have the tutor explain and use the key sequence notation that we use for keybindings and macros (best documented only by the code currently in helix-view/src/input.rs
I believe).
For now though let's be verbose and say things like 'press " and then # followed by Ctrl-a'.
Hey I'm happy to implement the requested changes if you don't have time @brunbjerg. I was actually stumped by this myself, and I agree that the proposed clarifications are required. I completely misparsed the |
runtime/tutor
Outdated
@@ -834,6 +834,28 @@ lines. | |||
|
|||
|
|||
|
|||
================================================================= | |||
= 7.5 PROGRESSIVE INCREMENTING AND DECREMENTING = |
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.
What does "progressive" mean here? I don't see it used in the keymap doc or the source. If it's redundant with the concept of incrementing, I find that confusing and it would be better to remove it. Luckily everything works fine grammatically if you just remove it from all three spots.
Edit: And of course, if it does mean something, it would be nice to add a sentence explaining that.
Edit 2: Ok, I saw this and finally got it. Like @mattkang, I misunderstood the "#
, so I wasn't able to get it to do the progressive thing. I stand by the point that the word "progressive" isn't sufficient to guess what the outcome of the key sequences is supposed to be.
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 took got the progressive part from this VSCode extension. I thought that it was standard terminology.
Edit: What do you think that it should be changed to instead?
c389b57
to
a905ef6
Compare
Thank you writing and reminding, I have made a new iteration of the PR. You are also welcome to changes to the branch :) |
runtime/tutor
Outdated
@@ -834,6 +834,28 @@ lines. | |||
|
|||
|
|||
|
|||
================================================================= | |||
= 7.5 PROGRESSIVE INCREMENTING AND DECREMENTING = |
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 might fit better in chapter 8. 8.1 introduces registers and how to select them. After that we could have a section that shows selecting the #
register and pasting (pastes the selection indices) and then incrementing and decrementing
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.
Something like this?
Also, would it make sense to expand the tutor for the remaining registers?
Like the '".' and '"%'?
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.
Yeah, what I'm thinking is that we introduce special registers first and then have a quick chapter on the basic use of the #
special register (just showing what happens when you use it to paste), and then the chapter after that can show increment/decrement
=================================================================
= 8.2 SPECIAL REGISTERS =
=================================================================
A few reserved registers don't behave like normal registers and
have special effects:
+ Read and write to the system clipboard
* Read and write to the primary clipboard
_ Discards all writes and reads nothing
% Reads the name of the current buffer
. Reads the current selections
# Reads the selection indices
Other than + and * these registers can't be written to.
=================================================================
= 8.3 SELECTION INDEX SPECIAL REGISTER =
=================================================================
The selection index special register can be used to insert
incrementing numbers under each selection.
1. Move the cursor to the first line marked '-->' below. Place
the cursor past the '-->'
2. Type C four times or 4C.
3. Type " and then # to select the # special register.
4. Use p to paste.
--> 00000
--> 00000
--> 00000
--> 00000
…ncrement-across-multiple-cursors-to-the-tutor
Added a section on how to do PROGRESSIVE INCREMENT AND DECREMENT.