How do I jump back to where I was before my last search?
``
The double backtick jumps to the exact position before the last jump.
``
The double backtick jumps to the exact position before the last jump.
:set incsearch
The incsearch option enables incremental search, which highlights matches in real time as you type the search pattern.
:tags
The :tags command displays the tag stack, showing all the tag jumps you have made with and their return points.
:tselect
When a tag has multiple definitions (e.
<C-w>]
The ] command opens the definition of the tag under the cursor in a new horizontal split.
<C-e>
The command scrolls the window down one line at a time while keeping the cursor on its current line (until the cursor would go off-screen).
<C-y>
The command scrolls the window up one line at a time while keeping the cursor position fixed.
:set scrolloff=5
The scrolloff option keeps a minimum number of lines visible above and below the cursor when scrolling.
zb
The zb command redraws the screen with the current line at the bottom of the window.
/pattern/e
Search offsets let you place the cursor at a specific position relative to the match.
]] and [[
The ]] and [[ motions jump between sections, traditionally defined as lines starting with { in the first column.
<C-t>
The command pops the tag stack and returns to the position from which you last used or :tag.
`{mark}
The backtick command ` ` followed by a mark name jumps to the exact line and column of that mark, unlike the single-quote ' which only goes to the line.
:lnext and :lprev
The location list is a per-window alternative to the quickfix list.
:cnext and :cprev
The quickfix list holds a set of file positions, typically from compiler errors, grep results, or other tools.
m{A-Z}
Uppercase marks (A-Z) are global marks that remember both the file and the cursor position.
]c
In diff mode, ]c jumps to the next change hunk and [c jumps to the previous one.
gj
The gj command moves the cursor down by one display line rather than one physical line.
{count}|
The command moves the cursor to a specific screen column on the current line.
g;
The g; command moves backward through the change list, jumping to positions where edits were made.