Search Forward in Vim (Linux)
Press Slash to search for a pattern from the cursor towards the end of the file.
What it does
The cursor jumps to the command line at the bottom. Type the text or the pattern and press Enter, and Vim moves to the next match after the cursor. One key repeats the search in the same direction and its capital in the opposite one. The search takes regular expressions. When it reaches the end of the file, it continues from the top.
The same shortcut on other platforms
| Platform | Shortcut |
|---|---|
| Linuxthis page | Slash |
| macOS |
More Vim shortcuts: Search
- Search Backward
- Next Match
- Previous Match
- Search Word Under Cursor
- Search Word Backward
All 30 Vim shortcuts for LinuxThe full list has a search and a printable PDF.
Questions
What is the Vim shortcut for Search Forward on Linux?
/ (Slash). Press it to search for a pattern from the cursor towards the end of the file.
What is the shortcut for Search Forward in Vim on macOS?
On macOS it is /.