How do I center the screen on the cursor line?
zz
The zz command scrolls the window so that the current cursor line appears in the middle of the screen.
17 results for "zz"
zz
The zz command scrolls the window so that the current cursor line appears in the middle of the screen.
zz / zt / zb
Vim's z scroll commands reposition the screen relative to the cursor without moving the cursor itself.
navigation #navigation #scrolling #viewport #cursor-position
<C-o>zz
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
zt / zb
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.
zt
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
navigation #navigation #scrolling #normal-mode #viewport #productivity
<C-o>{command}
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.
<C-o>{cmd}
Pressing in insert mode lets you execute one normal mode command and then automatically returns you to insert mode.
M
The M command moves the cursor to the line in the middle of the current window.
zb
The zb command redraws the screen with the current line at the bottom of the window.
<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).
:set scrolloff=999
By default, Vim only scrolls the viewport when the cursor reaches the very top or bottom of the screen.
navigation #navigation #scrolling #config #cursor #scrolloff
<C-u>
The (Ctrl+u) command scrolls the window up by half a screen, moving the cursor along with it.
<C-o> (in insert mode)
Pressing while in insert mode drops you into a special "insert-normal" mode where you can execute exactly one normal mode command, then immediately return to in
]m and [m
The ]m and [m motions let you jump forward and backward between the start of method or function definitions.
<C-d>
The (Ctrl+d) command scrolls the window down by half a screen, moving both the viewport and the cursor.
<C-w>c
The c (Ctrl+w then c) command closes the current window without closing the buffer it contains.
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