How do I debug a macro by stepping through it command by command?
:let g:debug_macro=1 | normal @a
When a macro doesn't work as expected, debugging it step by step is essential.
399 results for "it at"
:let g:debug_macro=1 | normal @a
When a macro doesn't work as expected, debugging it step by step is essential.
:s/pattern/\=expr/
Prefixing the replacement field of :s with \= makes Vim evaluate the rest as a Vimscript expression and use the result as the replacement string.
:verbose set {option}?
:verbose set {option}? shows the current value of an option and reports exactly which file set it last — the full path and line number.
R
Replace mode lets you type over existing text one character at a time, like the "Insert" key behavior in traditional editors.
/\cpattern
How it works By default, Vim searches are case-sensitive: /Hello will not match hello or HELLO.
= (in visual mode)
After making a visual selection, pressing = applies Vim's auto-indent to every selected line at once.
<C-r>/
Vim stores your last search pattern in the / register.
:g/pattern/normal A;
The :global command combined with :normal lets you execute arbitrary normal mode keystrokes on every line that matches a pattern.
command-line #global #normal-mode #editing #ex-commands #batch-editing
=i{ or =ap
The = operator performs smart indentation based on Vim's filetype-aware indent rules.
:'<,'>norm I//
After making a visual selection, :norm {commands} executes normal-mode keystrokes on every line in the range.
<C-y> / <C-e>
When typing in insert mode, you can pull individual characters from adjacent lines without leaving insert mode.
:%norm! A;
The :norm! (or :normal!) command executes normal mode keystrokes while ignoring all user-defined mappings.
\@= and \@! and \@<= and \@<!
Vim's regex engine supports zero-width lookahead and lookbehind assertions using the \@=, \@!, \@<=, and \@<! atoms.
:argdo norm @a | update
Combining :argdo with :norm @a lets you apply a recorded macro to every file in Vim's argument list — a powerful pattern for bulk refactoring across a project
cs"'
The vim-surround plugin by Tim Pope lets you change any surrounding delimiter pair with a single cs command.
plugins #plugins #surround #editing #text-objects #normal-mode
<C-u>
The (Ctrl+u) command scrolls the window up by half a screen, moving the cursor along with it.
:undojoin
When writing Vim scripts or running multiple Ex commands, each command normally creates a separate undo entry.
w
The w command moves the cursor forward to the beginning of the next word.
<C-w>_ and <C-w>=
When working with multiple splits, you often want to focus on one window by making it as large as possible, then restore equal sizing when you're done.
/\%>10c\%<20cpattern
When working with columnar data like CSV files, log files, or fixed-width records, you often need to match a pattern only when it appears in a specific column r