What is the unnamed register and how does it work?
The unnamed register "" is the default target for yank, delete, and change operations.
category:
registers
tags:
#registers
#unnamed
#default
How do you set the search register programmatically?
Use :let @/ = 'pattern' to set the search register directly.
category:
registers
tags:
#registers
#search
#set
What is the selection register in Vim and how do you use it?
The register represents the primary selection (middle-click paste in X11).
category:
registers
tags:
#registers
#selection
#primary
How do you set a register programmatically in Vim?
:call setreg('a', 'text')
Use setreg() to set register contents from Vimscript.
category:
registers
tags:
#registers
#setreg
#function
How do you paste over a visual selection without losing the register?
When pasting over a selection, the replaced text overwrites the unnamed register.
category:
registers
tags:
#registers
#paste
#selection
How do you paste a register using the :put command?
The :put a command pastes register a on a new line below the cursor.
category:
registers
tags:
#registers
#put
#command
What are the read-only registers in Vim?
Vim has read-only registers: % (current filename), # (alternate filename), .
category:
registers
tags:
#registers
#readonly
#special
How do you record a macro into a specific named register?
Press q followed by a lowercase letter (a-z) to start recording into that register.
category:
registers
tags:
#registers
#record
#macro
How do you paste from a register while in visual mode?
In visual mode, "ap replaces the selected text with the contents of register a.
category:
registers
tags:
#registers
#paste
#visual
How do you paste a register's contents multiple times?
Prefix the paste command with a count.
category:
registers
tags:
#registers
#paste
#multiple
How do you paste from a named register before the cursor?
Use "aP (uppercase P) to paste the contents of register a before the cursor position, as opposed to "ap which pastes after.
category:
registers
tags:
#registers
#paste
#before
How do you force a linewise register to paste characterwise?
:call setreg('a', @a, 'v') then "ap
Use setreg() to change register a to characterwise mode (v), then paste.
category:
registers
tags:
#registers
#characterwise
#paste
How do you paste a register value into the search prompt?
While in the search prompt (/), press a to insert the contents of register a.
category:
registers
tags:
#registers
#search
#paste
How do you access the last executed command in Vim?
The : register stores the last command-line command.
category:
registers
tags:
#registers
#command
#last
How do you access the last inserted text in Vim?
In insert mode, .
category:
registers
tags:
#registers
#last-inserted
#dot
What is the difference between register 0 and register 1 in Vim?
Register 0 always contains the last yanked text.
category:
registers
tags:
#registers
#numbered
#difference
How do you paste from a register with automatic indentation?
Use ]p after specifying a register to paste with adjusted indentation.
category:
registers
tags:
#registers
#paste
#indent
How do you insert the current filename from a register?
In insert mode, % inserts the current filename.
category:
registers
tags:
#registers
#filename
#insert
How do you retrieve a register's contents in Vimscript?
Use getreg('a') to get the contents of register a as a string.
category:
registers
tags:
#registers
#getreg
#function
How do you paste from a specific register while in insert mode?
In insert mode, press followed by the register name.
category:
registers
tags:
#registers
#insert-mode
#paste