folke / flash.nvim

Navigate your code with search labels, enhanced character motions and Treesitter integration
Apache License 2.0
2.47k stars 33 forks source link

feature: Convert labels into count for dot repeat #257

Closed fredizzimo closed 2 months ago

fredizzimo commented 11 months ago

Did you check the docs?

Is your feature request related to a problem? Please describe.

When using operator pending char mode f with jump_labels = true and you select another match then the first one, and then use dot repeat to repeat it, it acts as if the first occurrence of the character was pressed.

Describe the solution you'd like

It would be nice if the dot repeat operation was converted to a count operation instead, counting the number of matches between the start and the occurrence selected.

This would almost completely eliminate the need for counting in most cases.

Describe alternatives you've considered

I can't really think of an alternative.

Additional context

BTW, I really like this mode with jump_labels = true and label = { exclude = "" }, requiring me to confirm each motion with enter. It's a little bit slower in the best case, when the first match is the one you are trying to use, but a lot faster when it is not, especially in operator pending mode where you would have operated on the wrong thing. Also selecting the label, is faster than repeating if there are more than one match between for me, and otherwise almost the same, since the reaction time is much longer than the time it takes to type the label.

Despite using vim/neovim for over 10 years, constantly make the mistake of not noticing that the same character occurs several times. It's also much closer to kakoune/helix, where you get the visual confirmation first.

The only small additional change I would make in the regular jump, non-operator pending mode, esc should take you back to the original location, and enter confirm, useful if you make a typo for example.

fredizzimo commented 11 months ago

And a bonus feature would be a special dot repeat that requires you to select the label again, but otherwise perform the same operation.

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 2 months ago

This issue was closed because it has been stalled for 7 days with no activity.