PracticalVim Tip79 - yszheda/wiki GitHub Wiki

Table of Contents

Tip 79: Meet the Search Command

Return to the top: <>

Execute a Search

If you ever need to search from the current cursor position to the end of the document without wrapping around, you can disable the 'wrapscan' option.

References:

Specify the Search Direction

Repeat the Last Search

  • The `n` command preserves the direction as well as any offsets that were applied to the previous search.
  • The `N` command always goes in the opposite direction from the last search.
| Command | Effect | | `n` | Jump to next match, preserving direction and offset | | `N` | Jump to previous match, preserving direction and offset | | `/` | Jump forward to next match of same pattern | | `?` | Jump backward to previous match of same pattern |

Recall Historical Searches

When the search prompt is visible, we can scroll through the previous searches by pressing the `` key.

⚠️ **GitHub.com Fallback** ⚠️