How do I view or manipulate the search pattern register in Vim?
:echo @/
The / register holds the most recent search pattern.
:echo @/
The / register holds the most recent search pattern.
qa/pattern<CR>dd@aq
By starting a macro with a search command, the macro becomes conditional — it jumps to the next match before acting, and terminates when no more matches are f
qad/pattern\nq
Record a macro that deletes from the cursor to the next match of a pattern using d/pattern.
qa/pattern\nyy}pq
Record a macro that searches for a pattern, yanks the matching line, goes to the end of the paragraph, and pastes it.