10 months ago

Vim: Search for a term

When editing a long file with vim, you might need to try and find a certain word or term, but scrolling down is not really practical.

Luckily, Vim has your back and you can just use these two commands to search for a term through the whole file.

  • :?<term>
    • searches for that term from the cursor down
  • :\<term>
    • searches for that term from the cursor up

If you want to cycle through different occurrences of the same term you can use: - n or / - go to the next searched term - N or ? - go to the previous searched term

Do you have any comment on this tricks? then let the author know about that. comment here