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
How do you use the expression register to evaluate Vimscript?
In insert mode, = opens the expression register.
category:
registers
tags:
#registers
#expression
#vimscript
How do you use registers to exchange two pieces of text?
"adiw then move, "aP and diw
Delete the first word into register a with "adiw, move to the second word, paste register a before with "aP, then delete the remaining original.
category:
registers
tags:
#registers
#exchange
#swap
How do you use the expression register to insert a calculation?
In insert mode, press = to access the expression register, type a math expression like 42*7, and press Enter to insert the result (294).
category:
registers
tags:
#registers
#expression
#calculation
How do you change the case of text stored in a register?
Use Vimscript functions toupper() or tolower() with :let @a = toupper(@a) to convert the case of the entire register contents.
category:
registers
tags:
#registers
#case
#convert
How do you use the alternate file register?
The # register holds the alternate (previously edited) filename.
category:
registers
tags:
#registers
#alternate
#file