Skip to content
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

Add count support for repeat_last_insert '.' and repeat_last_select <a-.> #1602

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Delapouite
Copy link
Contributor

No description provided.

@lenormf
Copy link
Contributor

lenormf commented Sep 29, 2017

The repetition primitives already remember the count used during the last operation, allowing a count on those would not serve much purpose as they would only multiply the cached count.

@Delapouite
Copy link
Contributor Author

You're right. The . already remembers the count used in the command it repeats as you asked in #1465

But it's not the case of <a-.>.
Currently: ]p and 3]p acts the same. With this PR you can do ]p, and then 3<a-.>.

Also, back to the ., it offers interesting perspective.
For example making markdown headers. I'm a the beginning on the line I want to turn in a h1 : I#<esc>. I jump to the line I want to turn in a h2: 2.. Here comes a h4: 4.
So it's useful when you made a command with 1 count and want to repeat a various count times depending of the context.

Finally, multiplying the command count with the repeating_last_insert count could lead to powerful edit operations in its own way.

@lenormf
Copy link
Contributor

lenormf commented Sep 29, 2017

OK.

Currently: ]p and 3]p acts the same. With this PR you can do ]p, and then 3<a-.>.

As much as I understand the example, this would only be fixing a symptom, and not the root problem (which is that object selection doesn't support counts). Could be interesting in the mean time though.

Finally, multiplying the command count with the repeating_last_insert count could lead to powerful edit operations in its own way.

Such as? The current idiomatic way of repeating actions a fixed amount of times is through macros, which support counts already, do you have an example in mind?

@JJK96
Copy link
Contributor

JJK96 commented Nov 25, 2018

I second this, It happens quite often that I do an insert and want to repeat it a couple of times, so a count would be nice.

@JJK96
Copy link
Contributor

JJK96 commented Apr 16, 2019

@mawww Any reasons to not merge this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants