How do I repeat the last Ex command I ran?
@:
The @: command re-executes the most recently run Ex command (any command starting with :).
command-line #command-line #ex-commands #repeat #normal-mode #productivity
2277 results for "@a"
@:
The @: command re-executes the most recently run Ex command (any command starting with :).
command-line #command-line #ex-commands #repeat #normal-mode #productivity
g&
The g& command repeats the last substitute command across the entire file.
:noautocmd {command}
The :noautocmd prefix (abbreviated :noa) suppresses all autocommand events for the duration of the following command.
command-line #ex-commands #autocommands #performance #command-line #scripting
:set colorcolumn=80,120
colorcolumn highlights one or more screen columns to serve as a visual ruler.
:%center 80
Vim has three built-in Ex formatting commands — :left, :center, and :right — that align text within a specified column width.
:cdo keeppatterns s/\<foo\>/bar/gec | update
When quickfix already contains precise targets, :cdo gives you a safer multi-file replace loop than broad project substitutions.
command-line #command-line #quickfix #substitute #refactoring
:'<,'>s/\%V\s\+$//
Sometimes you need to clean alignment artifacts in a rectangular region without touching the rest of each line.
visual-mode #visual-mode #substitution #regex #formatting #editing
zf / zo / zc / za
Vim's folding system lets you collapse blocks of code into a single line, hiding the details so you can focus on the structure.
editing #editing #folding #navigation #normal-mode #productivity
:set virtualedit=onemore
By default, Vim's cursor cannot go past the last character of a line in normal mode — pressing $ lands on the final character, not after it.
:let @+ = expand('%:p')
Sometimes you need to share or use the full path of the file you're editing — for a terminal command, a config file, or a chat message.
:/start/,/end/ {command}
Vim's range addressing lets you specify a line range using search patterns instead of explicit line numbers.
set colorcolumn=+1
The colorcolumn option highlights one or more vertical columns to help keep lines within a length limit.
vim.api.nvim_set_hl(0, 'Normal', {bg='NONE'})
By default, Neovim paints a solid background color defined by the active colorscheme.
config #neovim #lua #config #highlight #colorscheme #transparency
)
The ) motion moves the cursor to the beginning of the next sentence.
zm
Instead of jumping between fully open (zR) and fully closed (zM), zm and zr let you step through fold levels one at a time.
:set foldmarker=region,endregion
When using foldmethod=marker, Vim looks for the strings in foldmarker to identify fold boundaries.
:cexpr system('rg --vimgrep "TODO"')
When you already know you want an external search tool, :cexpr lets you import results directly into quickfix without opening a terminal buffer or shelling out
:put =execute('messages')
Vim's :messages command shows recent output — error messages, echo'd values, and diagnostic information — but the display is ephemeral and hard to search.
:set wildmode=list:longest
Vim's wildmode option controls how the command line behaves when you press to complete filenames, buffer names, or Ex commands.
:bdelete
How it works The :bdelete command (often abbreviated :bd) removes the current buffer from Vim's buffer list and closes it.