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 digit 0 to 9 or single letter a to z.

(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 more permanent solution is to use emacs abbrevs.

Emacs: Abbrev Mode Tutorial

Copy/Paste Topic

  1. Emacs: Copy/Paste and kill-ring History
  2. Emacs: Copy/Cut Current Line If No Selection
  3. Emacs: Copy/Cut All or Selection
  4. Emacs: Paste or Paste Previous
  5. Emacs: Show kill-ring
  6. Emacs: Copy to Register
  7. Emacs: 1 Key to Copy/Paste from Register
  8. Emacs: Copy Rectangle Region to kill-ring
  9. Emacs: Sync Copy/Paste Clipboards with Linux X11
Like it? Buy Xah Emacs Tutorial. Thanks.