Search and navigation cheat sheet for VIM

  • / - search forward
  • ? - search backward
  • n - move forward to the next result
  • N - move backward to the next result
  • * - search word under the cursor (exact match)
  • # - search word under the cursor (exact match) in opposite direction / backward
  • g* - search for word under the cursor (prefix match)
  • g# - search for prefix under the cursor in opposite direction / backward (prefix match)
  • / or ? followed by or - show search history
  • / followed by Ctrl + r and then Ctrl + w - copy word under cursor to command line mode for searching