Vim has a very powerful search and replace mechanism. We learn to search forward and backward as well as how to replace first occurrences of a specific search criteria as well as replacing all occurrences.
- [Instructor] Searching and replacing text…in Vim is quite easy.…Let's start Vim with a new text file…by typing in vim space…search file….txt…and hitting enter.…Let's go into Insert mode by pressing I…and then adding some text.…I'm going to add line one,…line two,…line three,…line four,…and then the last line,…I'm going to type in line space line and hit enter.…Let's move our cursor to the top of the file.…
To search from your current position…toward the end of the document,…exit Insert mode by pressing Escape,…press forward slash to search and then start typing.…I'm going to search for the word Four and hit enter.…If you want to search from your current position…toward the beginning of the document,…then press the question mark and start typing.…So I'm typing in question mark three and hitting enter.…Let's search for something that we have more than one of,…like the word line.…Escape, forward slash, line, hit enter.…
You'll notice that Vim highlights each result.…To step forward to the results, press n.…To step backward to the results, press shift n.…
- Learning Linux command syntax
- Getting help on the CLI and GUI
- Finding help online
- Using basic commands
- Navigating file systems
- Editing text
Skill Level Intermediate
Learning Linux Command Line (2016)with Scott Simpson1h 38m Beginner
Linux: Bash Shell and Scriptswith Kevin Dankwardt2h 46m Intermediate
Setting up a Red Hat Enterprise Linux Serverwith Sandra Toner2h 46m Intermediate
1. Getting Help
2. Using Basic Commands
3. Navigating File Systems
4. Editing Text
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.