DELAPARRA
Index
Color
NL
Category: Keyboard shortcuts

/search

Explained by Updated

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.

Definition source Coders Lingo, CC BY 4.0

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

CategoryKeyboard shortcuts
Explained by
Updated

More Keyboard shortcuts terms

All terms starting with a number or symbol

Skills

Manuals

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.