Open ivanbrennan opened 7 years ago
This works just like C-r at the bash command prompt...
Yes, it should say /almost/ like
. I use C-r for swiper
very often, and it really makes sense to continue editing there.
In other cases as well: usually after C-r is done, there are more than 1 candidate. Simply going with the first of 10 available candidates would be quite inflexible and frustrating.
I'd like to make ivy-reverse-i-search behave the same, but I haven't found a way to do so. Is it possible?
You can redefine ivy-reverse-i-search
, it's very small. Replacing ivy--cd-maybe
with ivy--done
should do the trick.
Thanks, @abo-abo. Replacing (ivy--cd-maybe)
with (ivy-done)
works. I still need to find a way to allow further editing in the rarer cases where that's what I want.
Though using horizontal movements to select the match without executing it works outside of ivy, it's a bit of a hack. I'm going to try and bind the original behavior to shiftreturn.
That way, I could use:
The manual describes
ivy-reverse-i-search
saying,but in bash, typing return from within
reverse-i-search
will select and execute the current match, rather than simply inserting it on the command line and waiting for an other return to run it.I've always preferred this behavior to the way Emac's handles minibuffer i-search, because 99% of the time I want to execute the match without further editing. I've been using the following to adjust Emacs' behavior accordingly:
When I actually do want to edit the match before executing it, any horizontal cursor movement (e.g.
C-a
) will exit the search, leaving the match on the command-line/minibuffer without executing it.I'd like to make
ivy-reverse-i-search
behave the same, but I haven't found a way to do so. Is it possible?