Post

Vim Tip of the Day!

Copying lines containing search hits (source):

1.- Clear a register (eg 'a'): qaq
2.- Append all matching lines to that register: g/pattern/y A
3.- Copy contents of register a to clipboard (register '+'): let @+ = @a


Enjoy.
This post is licensed under CC BY 4.0 by the author.