In vim, if I have the following text:
hello there
Say I search for hell in the text above.
/hell
and press n to move to the next instance.
hell
o
hell is now highlighted in vim and my cursor is on the 'h'.
What is the most efficient way to now yank/delete that highlighted text.
Is there a way to 'yank to the end of the highlighted text'? Or 'create visual block from highlighted text'?
I know I can use %s/hell/whatever/gc to step through as an alternative.
TIA Tom
y//e
, or d//e
should do the trick.
:let @" = @/
as well, even if you have moved the cursor.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With