How do I save and quit Vim quickly from normal mode without typing a colon command?
ZZ
ZZ is a normal mode shorthand that saves and quits only if the buffer has been modified.
37 results for "zz"
ZZ
ZZ is a normal mode shorthand that saves and quits only if the buffer has been modified.
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
zz
The zz command scrolls the window so that the current cursor line appears in the middle of the screen.
<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
ZQ
ZQ is the discard-and-quit counterpart to ZZ.
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.
z<CR> and z. and z-
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.
z. and z<CR> and z-
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.
nzz
Typing nzz chains two normal-mode commands: n jumps to the next match of the last search, and zz immediately redraws the screen so the cursor line is vertically
z. / z-
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
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
50%
Prefixing the % command with a count jumps the cursor to that percentage through the file.
<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.
z.
Vim has two flavors of each screen-repositioning command: one that only moves the view and one that also repositions the cursor.
<C-o>{cmd}
Pressing in insert mode lets you execute one normal mode command and then automatically returns you to insert mode.
z<CR> and zt
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
z<CR>
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.
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).