Inserting from a Register
Ctrl-R is paste โ but with a twist.
Ctrl-R{reg} pastes a register contents from inside insert mode. Ctrl-R Ctrl-O pastes literally (no formatting); Ctrl-R Ctrl-P pastes and re-indents.
Ctrl-R{reg} from insert mode pastes the contents of any register. Unlike normal mode p, this works inline: characters appear at the cursor as if you'd typed them.
| Key | Note |
|---|---|
| {key:Ctrl-R} | Vim shows a " prompt, waits for register name |
| reg | Any register: a-z, 0-9, +, *, /, :, %, .โฆ |
| Variant | Behavior |
|---|---|
| Ctrl-Ra | Insert register a, processed normally |
| Ctrl-RCtrl-Oa | Insert register a literally (no autoindent, no abbreviations) |
| Ctrl-RCtrl-Pa | Insert register a and re-indent |
| Ctrl-R={expr}Enter | Evaluate an expression, insert the result |
Watch
See also: The Unnamed Register, Special Registers, Literal Insert and Digraphs