Search code examples
vimediting

"Find next" in Vim


To search forward in Vim for cake, I'd type /cake, but the cursor jumps to the first match when I press return. Is there a Vim command analogous to "find next"?


Solution

  • It is n for next and N for previous.

    And if you use reverse search with ? (for example, ?cake) instead of /, it is the other way round.

    If it is installed on your system, you should try to run vimtutor command from your terminal, which will start a tutorial of the basic Vim commands.

    Rob Wells advice about * and # is also very pertinent.