How do I mix very-nomagic and magic sections in a single Vim search?
/\Vsrc/main.c\m:\d\+<CR>
Sometimes you need one search pattern that treats a literal path strictly while still using regex power for the suffix.
/\Vsrc/main.c\m:\d\+<CR>
Sometimes you need one search pattern that treats a literal path strictly while still using regex power for the suffix.
\(pattern\)\@=
Vim's regex engine supports zero-width positive lookahead via the \@= operator.
\_.
In Vim's regular expressions, .
: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.