-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Find Mode
Александр Макунин edited this page Feb 8, 2025
·
13 revisions
To search, first press / then the search expression followed by <Enter>. You can alternate between the matches by typing n to go forward and <Shift-n> to go back.
- Find queries are persistent and scoped to a tab -- if you search for 'test' in a tab and later return to it, pressing
nwill search for the next instance of 'test' on the page. - If your search matches the contents of an input whose contents you wish to modify, press
<Esc>to enter insert mode and begin editing. - Find queries have a history. Use
<Up>and<Down>to re-use previous queries.
- Find mode uses smartcase -- it defaults to a case-insensitive search if you use only lower-case characters, but switches to case-sensitive mode upon detecting upper-case letters. Hence
/testis case-insensitive, and/Testis case-sensitive. - The
\rescape sequence ensures that the search string gets treated like a Javascript regular expression, so/t.st\rmatches 'test', 'tast', 'tost', etc. *You can find a guide on how to use JavaScript RegExp here. -
Case-sensitivity behaves the same way for regular expressions --./t.st\rwill match 'TosT', but/t.st\r\Iwill only match 'tast', 'tost', etc -
Blackslashes themselves can be escaped, so./test\\will match 'test\'