User Tools

Site Tools


emacs_tutorial

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
emacs_tutorial [2021/03/21 05:58] – [Extended Commands and Command Completion] hc9emacs_tutorial [2021/03/21 06:02] – [Kill & Yank (Cut/Copy and Paste)] hc9
Line 51: Line 51:
 ===== Kill & Yank (Cut/Copy and Paste) ===== ===== Kill & Yank (Cut/Copy and Paste) =====
  
-Most Emacs commands operate on the region defined by the //point//, which is the location of the cursor at any given time, and the //mark//, which is set with the command "C-space". To copy or cut a region of text, move the cursor to the start of the text area you are interested in and type "C-space". You will see "Mark set" in the echo area. Now move the cursor to the end of the text region (which moves the point) and type "M-wfor copy or "C-wfor cut (both called killing text). The text you copy or cut is stored by Emacs in the //kill-ring//, which is a circular buffer that stores the text snippets you kill in a last-in-first-out order. To paste the most recently stored text, move the cursor to where the text should be inserted, and type "C-y". The "y" stands for yank, what you'll see paste referred to in the Emacs help documentation (remember Emacs pre-dated modern windowing systems and other full-screen editors, so the terms cut and paste were not in use yet). After a yank ("C-y") command, you can replace the inserted text with earlier kills in turn by typing "M-yone or more times. Each time you press "M-ythe next block of killed text is popped off of the kill ring and inserted into your buffer, replacing the last insert at the same time.+Most Emacs commands operate on the region defined by the //point//, which is the location of the cursor at any given time, and the //mark//, which is set with the command ''C-space''. To copy or cut a region of text, move the cursor to the start of the text area you are interested in and type ''C-space''. You will see "Mark set" in the echo area. Now move the cursor to the end of the text region (which moves the point) and type ''M-w'' for copy or ''C-w'' for cut (both called killing text). The text you copy or cut is stored by Emacs in the //kill-ring//, which is a circular buffer that stores the text snippets you kill in a last-in-first-out order. To paste the most recently stored text, move the cursor to where the text should be inserted, and type ''C-y''. The "y" stands for yank, what you'll see paste referred to in the Emacs help documentation (remember Emacs pre-dated modern windowing systems and other full-screen editors, so the terms cut and paste were not in use yet). After a yank (''C-y'') command, you can replace the inserted text with earlier kills in turn by typing ''M-y'' one or more times. Each time you press ''M-y'' the next block of killed text is popped off of the kill ring and inserted into your buffer, replacing the last insert at the same time.
  
 Here are the commands we discussed above, and a few other useful ones: Here are the commands we discussed above, and a few other useful ones:
emacs_tutorial.txt · Last modified: 2021/03/21 06:38 by hc9