Emacs: Copy to Register

By Xah Lee. Date: . Last updated: .

Emacs has “registers” that allows you to store arbitrary text. It is like multiple-clipboards.

Let's say you have 2 pieces of text: A and B. You need to paste A in some places, paste B in other places.

Example use:

Register name can be any single letter a to z or single digit 0 to 9.

(info "(emacs) Registers")

One Keypress for Copy/Paste Register 1

Emacs's command for register requires you to chose a register. This is often annoying. Here's a command that just use register 1.

Emacs: 1 Key to Copy/Paste from Register

Use Abbrev for Templates

If you have some text you frequently want to paste, such as templates, a better solution is to use emacs abbrevs. [Emacs: Abbrev Mode]

Emacs Copy/Paste

Put $5 at https://www.patreon.com/xahlee , or goto paypal.com and pay to Xah@XahLee.org . Message me on XahLee discord, say so, ask me questions.
Or Buy Xah Emacs Tutorial

Emacs Tutorial

Emacs Init

Emacs Keys

ELisp

ELisp Examples

ELisp Write Major Mode


Emacs Tutorial

Quick Start

Manage Windows

File

Buffer

Find Replace

Copy/Paste

Unicode

Whitespace

Rectangle Edit

Line Wrap

Shell

View Special File

Editing Brackets

Org Mode

HTML

Emacs Efficiency

Misc