Cut, Copy and Paste in Emacs, is a bit different when compared to the standard commands. The parallelism is:
|Std name||Std CMD||Emacs CMD||Emacs name|
However, Emacs has a futher very useful tools: a clipboard (called kill-ring) history of copy/cut content.
You can see your copy history in two ways:
- via GUI-menu
Edit -> Paste from kill Menu;
- via CLI by calling describe-variable
F1-vand then typing
You can paste a previous copy content by calling yank-pop
M-y one or more time to insert from earlier history:
- First, do a paste
M-yto swap the paste content from previous entry;
M-yfor earlier content.
2. Multiple Clipboards: Emacs register
If you want to have a total control on the memorized content, you need to use the registers of Emacs. When a piece of text has been saved in a register, you can paste it all the times you want, by calling the proper register.
How to do it:
- Select a text, then call copy-to-register
C-x r s, then type
1. This will store the text in register ‘1’ (register can be any digit or letter).
- To paste, call insert-register
C-x r i, then type the register name.