How do I put a register as true line list so embedded newlines stay split correctly?
Most register pastes are character-oriented, but advanced edits often need to preserve exact line structure.
category:
registers
tags:
#registers
#ex-commands
#scripting
#text-processing
How do I jump back to where the cursor was when I last left a buffer?
The " mark is an automatic mark Vim sets whenever you leave a buffer — switching to another file, hiding the buffer, or quitting Vim (with viminfo/shada enabl
category:
navigation
tags:
#navigation
#marks
#buffers
How do I insert a register in Insert mode without reindenting each inserted line?
When you paste multiline snippets from a register while in Insert mode, default insertion can trigger indentation and formatting side effects line by line.
category:
registers
tags:
#registers
#insert-mode
#formatting
#indentation
#editing
How do I increment or decrement a number under the cursor?
Pressing increments and decrements the number under or after the cursor.
category:
editing
tags:
#editing
#numbers
#normal-mode
#increment
How do I evaluate a Vim expression and paste the result directly from a register?
The expression register lets you compute text on demand and insert it without leaving Normal mode workflows.
category:
registers
tags:
#registers
#expression-register
#normal-mode
#automation
How do I open Vim help pages in a new tab instead of a split?
By default, :help opens in a horizontal split, which can feel cramped.
category:
buffers-windows
tags:
#buffers
#windows
#tabs
How do I insert the result of a Vim expression onto a new line in the buffer?
The :put command inserts the contents of a register as a new line below the cursor.
category:
registers
tags:
#registers
#ex-commands
#editing
How do I preview a tag definition in a preview window using :ptag?
The :ptag command opens a tag definition in a small preview window at the top of the screen, letting you read the definition without losing your place in the cu
category:
buffers-windows
tags:
#buffers
#windows
#tags
#preview
#navigation
How do I edit a recorded macro to fix a mistake without re-recording it?
When a macro has a small mistake, re-recording the entire thing is tedious.
category:
macros
tags:
#macros
#registers
#editing
How do I run normal mode commands on a range while ignoring custom mappings?
The :norm! (or :normal!) command executes normal mode keystrokes while ignoring all user-defined mappings.
category:
command-line
tags:
#ex-commands
#editing
#normal-mode
How do I append text at the end of lines with different lengths using visual block?
When lines have varying lengths, a normal visual block selection stops at the shortest line.
category:
visual-mode
tags:
#visual-mode
#editing
#block-mode
#append
How do I insert a Unicode character by its code point?
<C-v>u{code} in insert mode
In insert mode, u followed by a 4-digit hex code inserts the Unicode character at that code point.
category:
editing
tags:
#editing
#insert-mode
How do I search for a pattern only on a specific line number or at a specific column position?
Vim's \%l and \%c pattern atoms anchor a search to a particular line number or column, enabling surgical searches and substitutions that standard regex cannot e
category:
search
tags:
#search
#regex
#ex-commands
How do I remove the last recorded keystroke from a register or macro in Vim?
Macros and named registers are just strings, so you can surgically edit them instead of re-recording from scratch.
category:
registers
tags:
#registers
#macros
#vimscript
#editing
How do I paste from a register in the command line?
<C-r>{reg} in command line
While on the : command line, pressing followed by a register name inserts that register's contents.
category:
registers
tags:
#registers
#command-line
How do I append the same suffix to every selected line in Visual mode?
Visual selections are not just for direct operators; they also define an Ex range.
category:
visual-mode
tags:
#visual-mode
#normal-mode
#editing
#ex-commands
#automation
How do I execute a Vimscript expression as a macro without recording it?
The @= command lets you type a Vimscript expression and execute the result as if it were a macro.
category:
macros
tags:
#macros
#registers
#ex-commands
How do I capture Vim command output to a variable or register using the execute() function?
:let @a = execute('messages')
The execute() function (added in Vim 8.
category:
command-line
tags:
#ex-commands
#registers
#macros
#command-line
How do I move backward to a character on the current line?
The F command moves the cursor backward to the previous occurrence of a specified character on the current line.
category:
navigation
tags:
#navigation
#motions
#normal-mode
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.
category:
macros
tags:
#macros
#debugging
#troubleshooting
#registers