How do I center the current line on screen and move to the first non-blank character?
z.
Vim has two flavors of each screen-repositioning command: one that only moves the view and one that also repositions the cursor.
953 results for ":normal"
z.
Vim has two flavors of each screen-repositioning command: one that only moves the view and one that also repositions the cursor.
zfap
Combining the fold-creation operator zf with the ap (around paragraph) text object gives you a quick way to collapse any paragraph into a single fold line.
qa<C-a>jq
By recording a one-step macro that increments a number and moves down a line, you can bulk-apply across as many lines as needed with a single count.
"ap, edit, "ayy
Vim stores macros in registers, which means you can paste a macro's contents into a buffer, edit it as regular text, and yank it back into the register.
:let @q = 'content'
:let @{reg} = 'string' directly assigns content to any named register from Vimscript.
ci" / ci( / ci{ / ci[ / ci` / ci'
The ci{delimiter} family of commands changes the text inside any matching pair of delimiters.
editing #editing #text-objects #change #delimiters #normal-mode
globpath(&rtp, 'pattern')
globpath() is a Vimscript function that searches all directories in a given path list for files matching a glob pattern.
]m and [m
The ]m and [m motions let you jump forward and backward between the start of method or function definitions.
:set nrformats-=octal
Vim's and increment and decrement numbers under the cursor.
zd
zd removes the fold definition at the cursor position — the text inside the fold is not deleted.
:earlier 1h
Vim's undo history is annotated with timestamps, allowing you to travel back to any point in time using :earlier and forward using :later.
:w !cmd
The :w !cmd command sends the buffer's contents as standard input to an external command without modifying the buffer.
\&
Vim's \& operator is the AND combinator in a search pattern.
\U, \L, \u, \l, \e in :substitute replacement
Vim's substitute command supports in-replacement case conversion metacharacters that transform the case of matched text without extra scripting.
<C-w>x
How it works The x command exchanges the current window with the next one.
W, B, and E
How it works Vim distinguishes between two types of word objects: A word (lowercase w, b, e) is a sequence of letters, digits, and underscores, or a sequence of
=G
The =G command applies Vim's auto-indent operator (=) from the current line to the last line of the file (G).
mA
Uppercase marks (A–Z) are global marks in Vim — they persist across files and even across sessions (when viminfo or shada is configured).
zR and zM
When working with a heavily folded file, manually opening or closing each fold is tedious.
:let @q = 'keystrokes'
You can assign a string directly to any register using :let, turning it into a macro instantly.