Книга: Learning GNU Emacs, 3rd Edition

2.3.1 Copying Text

2.3.1 Copying Text

To copy text, mark a region, then press M-w (for kill-ring-save; the toolbar icon with two pieces of paper also runs this command). Move the cursor to the place where you want to insert the copied text and press C-y. Copying text is exactly the same as killing it, except that Emacs doesn't delete anything. The text you have copied is placed in the kill ring, so you can use C-y to access it as often as you like.

One advantage to M-w is that it works on read-only files and buffers. For example, if you wanted to create a file of Emacs hints, you could use M-w to copy some text from online help into one of your buffers.

Here are the steps for some common deletion tasks.

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.

Оглавление книги


Генерация: 0.151. Запросов К БД/Cache: 0 / 0
поделиться
Вверх Вниз