When searching for a string with
C-s, I want to be able to hit some key to exit search mode but still maintain the selection of the match. That way I can immediately start typing and replace the last match.
For example, say I have the following document:
The quick brown fox jumps over the lazy dog.
If I search for "lazy", emacs will select that word like so (square brackets are selection, pipe is cursor):
The quick brown fox jumps over the [lazy|] dog.
Now, if I press return, emacs will maintain my cursor position, but it will deselect "lazy":
The quick brown fox jumps over the lazy| dog.
Instead of this, I want a shortcut that will exit search mode but maintain the current match selection, like in the second state above.