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 |
|---|---|
| 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
- ๐บ #0379 Ctrl-N Autocomplete Next (not yet published)
- ๐บ #0381 Ctrl-K Digraph (not yet published)
See also: The Unnamed Register, Special Registers, Literal Insert and Digraphs