Killing means erasing text and copying it into the kill ring, from which you can bring it back into the buffer by yanking it. (Some applications use the terms “cutting” and “pasting” for similar operations.) This is the most common way of moving or copying text within Emacs. It is very versatile, because there are commands for killing many different types of syntactic units.
Most commands which erase text from the buffer save it in the kill ring. These are known as kill commands. The kill ring stores several recent kills, not just the last one, so killing is a very safe operation: when you make a new kill, you don't have to worry much about losing text that you previously killed.
You can yank text from the kill ring into any position in a buffer,
including a position in a different buffer; the kill ring is shared by
all buffers. The C-/ (
undo) command can undo both kill
and delete commands (see Undo); the importance of the kill ring is
that you can yank the text in a different place.
Commands that erase text but do not save it in the kill ring are
known as delete commands. These include C-d
delete-char) and <DEL> (
which delete only one character at a time, and those commands that
delete only spaces or newlines. Commands that can erase significant
amounts of nontrivial data generally do a kill operation instead. The
commands' names and individual descriptions use the words ‘kill’
and ‘delete’ to say which kind of operation they perform.
You can also use the mouse to kill and yank. See Cut and Paste.blog comments powered by Disqus