Searching and Replacing
A variation on the cut-and-paste action is the search-and-replace action. This is useful if you need to make changes to every instance of a string within a file. The first step is the search. Searching is something you will do even if you are not interested in performing a replace. The following command places the cursor on the first instance of the string Den:
/Den/
Notice that no : exists in front of it; it is a command-mode command. This command searches forward from the current cursor position to the end of the file. If you want to search backward, you can surround the search string with ? instead of /. If the search finds an instance of the string, and you want to search for the same string again, you can type the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access