Vim 9 cheatsheet
Vim 9: Searching and replacing
9 common Vim 9 tasks.
Search forward
Search for text below the cursor. Press n for the next match and N for the previous one.
/pattern
Replace in a selection
After selecting lines in visual mode, replace only inside them. Vim fills in the range.
:'<,'>s/old/new/g
Delete all lines matching a pattern
Delete every line that contains the pattern.
:g/pattern/d
Caution: Check the pattern with a search first. Undo with u if it removes too much.
Ignore case unless you type capitals
Make searches case-insensitive unless the pattern has an uppercase letter.
:set ignorecase smartcase