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

Current word - vi Tutorial

From the course: Learning Vim

Start my 1-month free trial

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.

Contents