Emacs: Copy to Register

By Xah Lee. Date: . Last updated: .

What is Register

Emacs has registers that let you store text. (it can also store other data, such as split windows config.)

There are 36 registers, each one is named by a single letter a to z or single digit 0 to 9.

Copy Text to Register

  1. Select Text
  2. Alt+x copy-to-registerCtrl+x r s
  3. Type a letter or digit, e.g. e, stores the text in register e.

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

Paste from Register

  1. Alt+x insert-registerCtrl+x r i
  2. Type the letter name of the register. e.g. type e to paste from register e.

Reference

Emacs, Copy Paste