0

I usually use following way to search particularly words in open files in vim

:/word-name

It works but if there are several occurances of a word then I'll have to type of every single time to go to the next matching word. Is there a way to search the open file for words in vim and I keep pressing enter which will take me to next matching word rather keep typing it?

Om3ga
  • 30,465
  • 43
  • 141
  • 221

2 Answers2

2

You could just type 'n' and the next hit is highlighted. See "Find next" in vim.

Community
  • 1
  • 1
triplem
  • 1,324
  • 13
  • 26
0
  1. Search for the word by pressing '/' and typing the desired word
  2. Then to get the next occurrence of the word, press 'n'

Extra Tips:

To get to the previous occurence of the word, press 'N'

Also, you can go to the next occurence of the word that your cursor is on by using '*'