/search
What is /search?
/search: Vim: search forward for a pattern. Press n for the next match, N for the previous. In Vim, pressing / starts a forward search. Type a word or pattern, press Enter, and the cursor jumps to the next match. Press n to go to the next match and N to go back. ? does the same search backwards.
Frequently asked questions about /search
How is /search used in practice?
The search accepts regular expressions, so /function \w\+ finds function definitions. Adding \c anywhere in the pattern makes it ignore case for that search. :set hlsearch marks every match on the screen, and :noh clears the highlight again.
What should you keep in mind with /search?
The same key works in many other tools you already use. less, man pages and more all support / to search the text on screen. Once the habit is in your fingers, reading a long log file or a manual page in the terminal becomes much faster than scrolling.
At a glance
| Category | Keyboard shortcuts |
|---|---|
| Explained by | Reinier de la Parra |
| Updated |