How do I search only a sub-part of a larger pattern using \zs and \ze?
/foo\zsbar\zebaz<CR>
Sometimes you need Vim to match a long structural pattern but only treat one piece of it as the actual match.
/foo\zsbar\zebaz<CR>
Sometimes you need Vim to match a long structural pattern but only treat one piece of it as the actual match.
/\(function\s\+\)\zs\w\+
Vim's \zs and \ze atoms let you control which part of a matched pattern gets highlighted and operated on.