How do I open the file whose name is under the cursor in a new tab?
<C-w>gf
gf reads the filename under the cursor and opens it in a new tab page, keeping your current buffer untouched.
<C-w>gf
gf reads the filename under the cursor and opens it in a new tab page, keeping your current buffer untouched.
zl and zh
When a line is longer than the window width and wrap is off, Vim can display only part of it.
gM
The gM command moves the cursor to the horizontal middle of the current line, regardless of how long the line is.
]]
The ]] motion jumps forward to the next line that starts with { in the first column, which is typically the beginning of a C-style function or section.
`< and `>
The ` ` marks automatically track the boundaries of the last visual selection.
:set scrollbind
The scrollbind option locks the scrolling of two or more windows together so they scroll in unison.
(
The ( motion moves the cursor backward to the start of the current or previous sentence.
`[ and `]
The ` [ ` and ] ` marks automatically track the boundaries of the last changed or yanked text.
``
The double backtick jumps to the exact position before the last jump.
: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.