What is the difference between zt and z-Enter when scrolling the current line to the top of the screen?
Both zt and z scroll the view so that the current line lands at the top of the screen, but they differ in one small but important way: z also moves the cursor t
category:
navigation
tags:
#navigation
#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 scroll the screen so the current line is at the top or bottom?
The zt and zb commands scroll the viewport so the current cursor line appears at the top or bottom of the screen respectively, without moving the cursor.
category:
navigation
tags:
#navigation
#scrolling
#viewport
#normal-mode
How do I scroll the screen so the current line is at the top?
The zt command repositions the viewport so that the line where your cursor sits moves to the top of the screen, without changing your cursor position within the
category:
navigation
tags:
#navigation
#scrolling
#normal-mode
#viewport
#productivity
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 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 current line to the center or top of the screen and simultaneously move my cursor to the first non-blank character?
Vim has two parallel sets of scroll commands: the well-known zz, zt, zb which reposition the view without moving the cursor, and the lesser-known z.
category:
navigation
tags:
#navigation
#normal-mode
How do I center the screen on the cursor line?
The zz command scrolls the window so that the current cursor line appears in the middle of the screen.
category:
navigation
tags:
#navigation
#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 resize the current window to an exact number of lines from the command line?
The z{height} command simultaneously resizes the current window to exactly {height} lines, scrolls so the current line sits at the top of the window, and moves
category:
buffers-windows
tags:
#buffers-windows
#windows
#resize
#navigation
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
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 scroll up half a page in Vim?
The (Ctrl+u) command scrolls the window up by half a screen, moving the cursor along with it.
category:
navigation
tags:
#navigation
#motions
#normal-mode
How do I move the cursor to the top of the visible screen?
The H command moves the cursor to the first line of the currently visible screen (the "High" position).
category:
navigation
tags:
#navigation
#motions
#normal-mode
How do I run a single normal-mode command without leaving insert mode?
While typing in insert mode, you sometimes need to do a quick normal-mode action — center the screen, jump to a mark, or delete a word backward.
category:
editing
tags:
#insert-mode
#normal-mode
#editing
#motions
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 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 quickly resize the current window to exactly N lines tall in Vim?
The z{N} command sets the current window's height to exactly N lines and simultaneously positions the current line at the top of the window.
category:
buffers-windows
tags:
#buffers-windows
#windows
#navigation
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 move the cursor to the middle or bottom of the visible screen?
M to move to the middle, L to move to the bottom
How it works Vim offers three commands to jump the cursor to specific vertical positions on the visible screen without scrolling: H moves to the top of the scre
category:
navigation
tags:
#navigation
#motions
#normal-mode