I am trying to perform an action on a searched pattern but I can't figure out how to do that. The goal here is to be able to yank a pattern but so far I can only yank a whole line. Is there a trick that will make this command operate only on a matched pattern?
:/pattern.*/v
If your Vim is recent enough (7.3.6xx), you can use gn
in combination with :normal
:
:/foo/normal ygn
To yank to a specific register:
:/foo/normal "aygn
See :help :normal
and :help gn
.
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