How do I remove the most recent Ex command from command history in Vim?
:call histdel(':', -1)
When you run sensitive or noisy Ex commands, they stay in command history and can be recalled accidentally.
272 results for ":q"
:call histdel(':', -1)
When you run sensitive or noisy Ex commands, they stay in command history and can be recalled accidentally.
:set equalprg={program}
The equalprg option replaces Vim's built-in = indentation operator with any external formatting program.
:filter /{pattern}/ history cmd
When command history gets crowded, scanning :history cmd manually is slow.
:Man {name}
Neovim ships with a built-in :Man command (the man.
command-line #neovim #navigation #documentation #command-line
qa0f:dwj0q
How it works When recording a macro that you plan to repeat across multiple lines, the key technique is to end the macro positioned on the next line, ready for
:set makeprg=
The makeprg option defines the command that :make runs.
\%#
The \%# atom in Vim's regex engine matches the exact position of the cursor — zero-width, between characters.
:'<,'>norm I//
After making a visual selection, :norm {commands} executes normal-mode keystrokes on every line in the range.
:'<,'>normal @@
When you already have a useful macro but need to apply it to a specific block of lines, :'normal @@ is a high-leverage pattern.
:debug
The :debug command prefix puts Vim into its built-in interactive debugger before executing the given command.
command-line #ex-commands #debugging #command-line #vimscript
w
The w command moves the cursor forward to the beginning of the next word.
5:
Typing a count before : in normal mode automatically fills in a line range in the command line.
command-line #command-line #ex-commands #ranges #normal-mode
:cdo s/old/new/ | update
:cdo {cmd} executes a command at every entry in the quickfix list, visiting each location in turn.
gq (visual mode)
Pressing gq on a visual selection reformats the selected lines to hard-wrap at textwidth columns.
:lua {code}
Neovim's :lua command lets you run arbitrary Lua code inline from the command line.
command-line #command-line #lua #neovim #vimscript #advanced
:'<,'>
Vim automatically sets two special marks whenever you make a visual selection: ' (end).
:tjump
:tjump {identifier} is the smart tag-jumping command: it jumps directly when there is only one matching tag, but shows an interactive numbered list when multipl
:normal! {cmds}
:normal {cmds} executes normal-mode keystrokes from the command line, but it honors your custom key mappings — so remapped keys produce unexpected results in
command-line #ex-commands #macros #normal-mode #command-line
require('telescope.builtin').grep_string()
Telescope's grepstring() function performs a project-wide search for the exact word currently under the cursor, displaying live-previewed results in an interact
:set lazyredraw
When Vim runs a macro or an :argdo / :bufdo loop, it redraws the screen after every command by default.