tags:

views:

607

answers:

4

Hi,

I'd like to just delete some text so I can yank some other text instead of it. How can I do that? C-w cuts the selected text to kill ring and I end up without the text I wanted to yank.

Also, is it possible to yank text directly instead of some text without even pressing buttons to kill it?

+8  A: 

You can use M-y after C-y to insert previous item from the kill ring, or use browse-kill-ring package.

As for the second question, see DeleteSelectionMode.

Eugene Morozov
+5  A: 

I type M-x delete-region quite often, but you can bind it it to a key.

I don't understand the second question. Do you mean kill-ring-save with M-w?

ashawley
+1  A: 

For your second question, alternatively to DeleteSelectionMode you can enable CUA Mode which additionally gives you a nice rectangle selection mode enabled by C-Return. CUA mode is part of emacs since 22.1.

danielpoe
A: 

M-x eval-expression (setq kill-ring (cdr kill-ring)) - removes last item from kill-ring

Evgeny