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.
1039 results for "i" a""
zz
The zz command scrolls the window so that the current cursor line appears in the middle of the screen.
:nnoremap <buffer> <leader>r :!python %<CR>
How it works By adding to a mapping command, the mapping only applies to the current buffer.
g<C-]>
When a symbol (function, class, variable) is defined in multiple places, CTRL-] blindly jumps to the first match.
"0p
Register 0 (the yank register) always contains the text from your most recent yank command — and unlike the unnamed register, it is never overwritten by delet
:keeppatterns {command}
The :keeppatterns modifier runs an Ex command — typically :s, :g, or :v — without modifying @/ (the last search pattern) or the command history.
command-line #ex-commands #search #substitution #command-line #scripting
<C-r><C-o>"
The {register} sequence in insert mode pastes register contents literally — without triggering auto-indentation, abbreviations, or mappings.
:vimgrep /pattern/ **/*
While external tools like grep or ripgrep are fast, Vim's built-in :vimgrep has a key advantage: it populates the quickfix list directly, so you can jump betwee
:set opfunc and g@
Vim's operatorfunc option lets you define your own operators — just like the built-in d, y, or c — that accept any motion or text object.
<C-r>:
Vim stores your last executed Ex command in the read-only : register.
:e %:r.html
In Vim's command line, % expands to the current buffer's filename.
command-line #ex-commands #command-line #buffers #navigation
:keeppattern %s/old/new/g
When you run a :s or :%s substitute command, Vim updates the search register (@/) with the substitution pattern.
command-line #ex-commands #search #editing #registers #substitute
yy
The yy command yanks (copies) the entire current line, including the newline character.
"1pu.u.u.
Vim stores the last 9 deletions in numbered registers 1-9, with the most recent in register 1.
!{motion}command
The ! operator in normal mode pipes text through an external shell command and replaces it with the output.
:b partial<Tab>
The :b (buffer) command accepts partial filename matching with tab completion.
<C-f> (from command-line mode)
When you are partway through typing a long or complex Ex command on the : prompt, you can press to open the command-line window.
q:
The command-line window is a special buffer that shows your entire Ex command history and lets you edit entries using the full power of Vim's normal mode before
command-line #command-line #ex-commands #history #editing #productivity
<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).
:%s/\<\w\+\>/\=toupper(submatch(0))/g
The \= flag in the replacement part of :substitute tells Vim to evaluate what follows as a Vimscript expression instead of treating it as a literal string.
<C-w>+
When working with multiple split windows, you often need to resize them to see more content in one pane.