How do I keep multiple split windows scrolling and cursoring in sync?
:windo setlocal scrollbind cursorbind
When reviewing related files side by side, alignment drifts quickly if each window scrolls independently.
category:
buffers-windows
tags:
#buffers-windows
#windows
#scrolling
#comparison
How do I control how many lines Ctrl-U and Ctrl-D scroll?
The scroll option determines how many lines (scroll up) and (scroll down) move the viewport.
category:
config
tags:
#config
#navigation
#scrolling
#ctrl-u
#ctrl-d
How do I scroll the view left and right one column at a time when line wrapping is off?
When wrap is disabled, long lines extend off-screen.
category:
navigation
tags:
#navigation
#scrolling
How do I make half-page scrolling move through wrapped lines instead of jumping over them in Neovim?
By default, Neovim's half-page scroll commands (, , , ) count movement by text lines, not screen rows.
category:
config
tags:
#config
#navigation
#scrolling
How do I scroll the screen while also jumping to the first non-blank character of the current line?
Vim has two sets of scroll-and-position commands: zt/zz/zb (which reposition the screen but keep the cursor column intact) and z/z.
category:
navigation
tags:
#navigation
#scrolling
#normal-mode
How do I redraw the screen with the cursor line at center or bottom and move to the first non-blank character?
Vim has scroll-positioning commands that come in two flavors: those that leave the cursor in the current column (zz, zt, zb) and those that also move the cursor
category:
navigation
tags:
#navigation
#normal-mode
#scrolling
How do I scroll through wrapped long lines smoothly without skipping screen rows?
The smoothscroll option makes scroll commands respect screen rows rather than buffer lines when wrap is enabled.
category:
config
tags:
#config
#navigation
#scrolling
#wrap
How do I center the current line on screen and move to the first non-blank character?
Vim has two flavors of each screen-repositioning command: one that only moves the view and one that also repositions the cursor.
category:
navigation
tags:
#navigation
#normal-mode
#scrolling
How do I scroll the view horizontally by half a screen width in Vim?
zH and zL scroll the viewport horizontally by half a screen width, letting you navigate wide content efficiently when wrap is disabled.
category:
navigation
tags:
#navigation
#scrolling
#horizontal
#nowrap
#motions
How do I scroll the current line to the top of the screen and move the cursor to the first non-blank character?
While zt scrolls the current line to the top of the screen, z does the same scroll but also moves the cursor to the first non-blank character of that line.
category:
navigation
tags:
#navigation
#scrolling
#normal-mode
#motions
How do I scroll the buffer up or down while staying in insert mode?
<C-x><C-e> and <C-x><C-y>
While in insert mode, scrolls the window up one line and scrolls it down one line — all without leaving insert mode.
category:
editing
tags:
#insert-mode
#editing
#scrolling
How do I scroll the view horizontally so the cursor sits at the leftmost or rightmost visible column?
When nowrap is set and lines extend beyond the screen width, zs and ze snap the horizontal scroll position so the cursor sits exactly at the left or right edge
category:
navigation
tags:
#navigation
#scrolling
How do I keep the cursor line always centered on the screen while scrolling?
By default, Vim only scrolls the viewport when the cursor reaches the very top or bottom of the screen.
category:
navigation
tags:
#navigation
#scrolling
#config
#cursor
#scrolloff
How do I center the screen on my cursor without leaving insert mode?
When you are typing in insert mode and the cursor drifts near the top or bottom of the screen, you normally have to press , then zz, then i or a to continue edi
category:
navigation
tags:
#navigation
#insert-mode
#scrolling
#normal-mode
How do I scroll the screen to position the cursor line at the center, top, or bottom?
Vim's z scroll commands reposition the screen relative to the cursor without moving the cursor itself.
category:
navigation
tags:
#navigation
#scrolling
#viewport
#cursor-position
How do I make two windows scroll together in sync?
The scrollbind option locks the scrolling of two or more windows together so they scroll in unison.
category:
navigation
tags:
#navigation
#scrolling
#windows
How do I scroll the screen down by one line without moving the cursor?
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).
category:
navigation
tags:
#navigation
#scrolling
#normal-mode
How do I scroll the screen up by one line without moving the cursor?
The command scrolls the window up one line at a time while keeping the cursor position fixed.
category:
navigation
tags:
#navigation
#scrolling
#normal-mode
How do I set a minimum number of lines to keep visible above and below the cursor?
The scrolloff option keeps a minimum number of lines visible above and below the cursor when scrolling.
category:
navigation
tags:
#navigation
#scrolling
#config
How do I scroll so the current line is at the bottom of the screen?
The zb command redraws the screen with the current line at the bottom of the window.
category:
navigation
tags:
#navigation
#scrolling
#normal-mode