How do I run normal mode commands in a script or macro without user mappings interfering?
:normal!
The :normal! command (with !) executes normal mode keystrokes exactly as Vim defines them, ignoring any user-defined mappings.
795 results for "g* g#"
:normal!
The :normal! command (with !) executes normal mode keystrokes exactly as Vim defines them, ignoring any user-defined mappings.
42G
The 42G command jumps the cursor directly to line 42 in the current file.
:WhichKey
which-key.
~
The ~ command toggles the case of the character under the cursor — uppercase becomes lowercase and vice versa — then advances the cursor one position to the
:cdo {cmd}
:cdo executes an Ex command on every entry in the quickfix list in sequence, visiting each match in turn.
:let @a = ""
The :let @{register} = "" command empties a register.
<C-v> (command-line mode)
In command-line mode (after : or /), pressing followed by any key inserts that key literally — bypassing all key notation, mappings, and special interpretatio
q/k?pattern<CR>
Vim's command-line history window (q: for Ex commands, q/ for search) opens a full editing buffer containing your history.
Use :s/pat/rep/e flag or :silent! prefix
By default, Vim macros abort on the first error — a failed search, a substitute with no matches, or a movement that can't be performed.
:&&
After running a :s/pattern/replacement/g command, you often need to repeat it on another line or range.
gj and gk
When wrap is enabled, long lines wrap across multiple screen lines.
\u / \l / \U / \L (in :s replacement)
Vim's :substitute replacement string supports case-conversion modifiers that let you uppercase or lowercase matched text without writing a separate command.
gg
The gg command moves the cursor to the first line of the file.
:ALEFix
ALE (Asynchronous Lint Engine) is a popular Vim plugin that runs linters and formatters asynchronously in the background, showing errors and warnings in the gut
"/ register
The / register contains the most recent search pattern.
When recording a macro, you can execute another macro inside it by pressing @b (or any register) during the recording.
:Lexplore
:Lexplore opens Vim's built-in netrw file explorer as a persistent sidebar anchored to the left of the screen.
buffers-windows #netrw #file-explorer #buffers #windows #navigation
==
The == command auto-indents the current line based on the surrounding context.
:set tildeop
By default, ~ toggles the case of a single character and advances the cursor.
:TOhtml
The :TOhtml command converts the current buffer — complete with its syntax highlighting colors — into a standalone HTML file.