Skip to content

Instantly share code, notes, and snippets.

@jtuz
Forked from dinjas/vim_copy_lines.text
Created June 12, 2024 19:58
Show Gist options
  • Save jtuz/2e990699a54f0345cfd20ccd96859c8c to your computer and use it in GitHub Desktop.
Save jtuz/2e990699a54f0345cfd20ccd96859c8c to your computer and use it in GitHub Desktop.
How to copy lines matching pattern in vim
qaq # clear register A
:g/pattern/y A # copy lines matching pattern to register A
:let @+ = @a # copy register A to clipboard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment