Searching your way through vim
/\<hello world\>/
\<
and \>
mark the start and end of a whole word resp./red\&.*blue/
This will highlight everything b/w "red" and "blue" on the same line.
\&
also called as "Branch" matches the last pattern but only if all the preceding patterns match at the same positionExample: Find f-strings
f"\&.*"
hello\_.*world
This will highlight everything between hello world.
Example: Find try/catch block
hello\_.*world
"\_.*except"
matches all text from the current position to the last occurrence of "except" in the file.Read:help pattern.txt
for everything related to pattern searching.
Last modified 1yr ago