Registers
A register holds text you have yanked or deleted, ready to paste. yumete keeps one unnamed register, any number of named ones, and a history of what the unnamed one held. The system clipboard is separate: it is the + and * registers, and it has its own keys.
The unnamed register
With no register named, these keys use the unnamed one:
| Key | Effect |
|---|---|
y | yank the selection |
d / c | delete / change the selection, keeping what was removed |
A-d / A-c | delete / change the selection, leaving the register as it is |
p / P | paste after / before the selection; a count (3p) pastes that many copies as one piece |
R | replace the selection with the register; 2R replaces it with two copies (helix keymap; under vim, R in Normal mode is vim's replace mode) |
C-r " (Insert) | insert the register's text at the cursor |
If you would rather d and c left the register alone, :keymap-yumete-flavor on swaps them with A-d and A-c. Set flavor = true under [keys] to make that the default.
Under the vim keymap a paste leaves a cursor, not the pasted text selected. The cursor goes to the last character pasted when the text is part of one line, to the first character pasted when it spans lines, and to the first non-blank of the first pasted line when whole lines were pasted.
With several selections, each yanks its own piece, and pasting into as many selections puts each piece back in its place.
Named registers
Type " and a character before a yank, delete or paste to use that register instead:
"ayyanks the selection into registera."appastes from registera."bddeletes the selection into registerb.C-r ain Insert mode inserts registera.
Any character can name a register, and three names are special, as in helix and vim:
_keeps nothing."_ddeletes without changing whatppastes.+and*are the system clipboard."+ycopies the selection out of the editor, and"+p,"+Pand"+Rpaste or replace from it.#reads as the selection's number, so"#Pwith three cursors writes1,2and3.
Under the vim keymap, "0 holds the last yank, as in vim: a delete fills the unnamed register, and "0p still pastes what you yanked. A delete of a line or more also goes into "1, and the older ones move down to "2 … "9.
Earlier yanks
Every yank or delete into the unnamed register replaces what was there, but the last 16 are kept. Space " or :clipboard opens a picker of everything that can be pasted:
- the system clipboard, first
- the unnamed register's history, newest first, numbered from
0 - the named registers, as
"a,"band so on
Pick one and it is pasted after the selection. The picker's numbers are its own: the row 0 is the newest yank or delete, not the "0 register, which has a row of its own under the named registers.
The system clipboard
| Key | Command | Effect |
|---|---|---|
Space y | :clipboard-yank | copy the selection to the system clipboard, and into the unnamed register |
Space p | :clipboard-paste | paste from the system clipboard after the selection |
Space P | paste from the system clipboard before the selection |
Copying uses the terminal's OSC 52 escape, so it works over ssh and inside tmux, if the terminal allows it. Pasting runs pbpaste on macOS, or wl-paste, xclip or xsel on Linux. The terminal's own paste key also works.
Macros are not kept in registers. There is one macro, the last one recorded: Q records and q replays it under the helix keymap, the other way round under vim. A letter after q does not name a register.