helix
helix copied to clipboard
insufficient repeat
The current repeat only repeat's last insertion. Alt-. repeat's last motion. This leaves out sequences like wd, ms(, etc.
Adding these under . probably doesn't do any damage. Since, a lot of vim users use plugins like vim-repeat which repeat last surround under the same .(period) key. It pollutes last repeat but fine really.
Or if polluting repeats is a problem then a picker for repeats would solve this problem and helix wouldn't need Alt-.
I've been trying to transition to hx from nvim lately, and this is one of my biggest pain points right now. would like to do some movement and an insertion and be able to repeat the whole thing with .
something like miwc some_text and be able to apply the same to other words easily.
miwc some_text
That will repeat just fine with Alt-. ..
@archseer That is not a very good repeat IMO.
- Bindings here can be simplified
- Can't repeat
miwd
If helix strictly wants to keep "match" repeats different from other repeats then I'd suggest putting repeat under "match" mode:
mr: Repeat match without action. This is similar toAlt-.alonemR: Repeat match with action(delete, insert text). This looks better thanAlt-. .
I do not know why delete actions cannot be repeated with .. Is repeating delete actions a bad idea?
. repeats the last insert.
If you're repeating a lot, you are most likely not taking advantage the indended usage of multiple selections.
If the entire action of miwd could be repeated, it would break select-then-act: you couldn't see what you were deleting before you deleted it.
Would it make sense to add a command and binding for "repeat_last_command"?
A use case could be: say you want to perform "extend_line_above" or "kill_to_line_end" a few times and don't have a custom binding setup. Then you may bring up the command palette, find the command, hit enter, and then repeat the command as many times you'd like with a keystroke.
currently i am using the workaround to (1) search string (2) record a macro (3) press anything necessary and stop recording, then repat as often as necessary: (4) search again and (5) replay the macro:
/<search-text> ENTER Q <do whatever i want> ESC Q n q n q
fyi. Related discussion (over the past day) found here: https://github.com/helix-editor/helix/discussions/8311
also fyi: I'm told (in above discussion) the hx . code is found here (as of 2023-09-17, anyway):
https://github.com/helix-editor/helix/blob/master/helix-term/src/ui/editor.rs#L895-L929