From the course: Learning Vim
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Current word
- [Instructor] A lot of times, I'm at a position in the text where there is a word, and I'd like to see where I used the same word next. This is common when programming and trying to find out when a variable is used. Open sherlock.txt, vim sherlock.txt. And now type 3j6w. What did you just do? You moved three lines down, and six words to the right. Now we'd like to see where the name Irene is used next. Instead of using search with forward slash, we can use the asterisk. So, asterisk, the asterisk command searches forward for the word under the cursor. Now we can use End or asterisk again to repeat the search. End, end. This is super handy. I'm using it a lot, it's a big time saver. If you like to search backwards for the current word, use the hash mark. Hash mark, hash mark.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Navigate using keys: H, J, K, L1m 11s
-
(Locked)
Words, sentences, and paragraphs1m 46s
-
(Locked)
Challenge: Find word19s
-
(Locked)
Solution: Find word31s
-
(Locked)
Regular expressions1m 56s
-
(Locked)
Challenge: Search word8s
-
(Locked)
Solution: Search word14s
-
(Locked)
Screen movement47s
-
Challenge: Move screens5s
-
Solution: Move screens12s
-
(Locked)
Lines1m 40s
-
(Locked)
Challenge: Move lines14s
-
(Locked)
Solution: Move lines16s
-
(Locked)
Current word59s
-
(Locked)
Challenge: Find next instance of word23s
-
(Locked)
Solution: Find next instance of word22s
-
(Locked)
-
-
-
-
-
-