Home > emacs > Learning Emacs – Ch 2 (Deleting blocks of text)

Learning Emacs – Ch 2 (Deleting blocks of text)

Chapter 2 – Deleting blocks of text.
(The books summarizes this very nicely)

To mark a region:
1. Move the cursor to the beginning of the area you want to delete.
2. Press C-Space. Emacs displays the message Mark set.
3. Move the cursor to the end of the region you want to delete.

To delete a region:
1. Mark the region to be deleted.
2. Press C-w to delete the region.

To move text:
1. Delete the text you want to move using the procedures for marking and deleting a region.
2. Move the cursor where you want to insert the text.
3. Press C-y. Emacs inserts the text you deleted.

To copy text:
1. Mark the region you want to copy.
2. Press M-w to copy the text.
3. Move the cursor where you want to insert the copied text and press C-y. Emacs inserts the text you copied.

So to

A. Cut text
1. C-Space or C-@ [ to set a mark]
2. C-w (kill-region) [Delete the part you just marked.]

B. Copy text
1. C-Space or C-@ [ to set a mark]
2. M-w [Copy the part you just marked.]

C. Paste text
1. C-y (yank) [ restore what you deleted in this case what was “copied” or “cut” ]

 
source: “Learning GNU Emacs, 3rd Edition by Debra Cameron, James Elliott, Marc Loy. Copyright © 2005 O’Reilly Media, Inc. ISBN 0-596-00648-9”

Advertisements
Categories: emacs Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: