gn and cgn
gn
searches forward and visually highlights the last search pattern.
If you had searched for "foo" (/foo
), you can run cgnbar
to change the next "foo" and replace it with "bar".
This works great with the dot command. You can now just run ...
, instead of n.n.n.