Kill the region (
Copy the region into the kill ring (
Kill the next word (
kill-word). See Words.
Kill one word backwards (
Kill back to beginning of sentence (
Kill to the end of the sentence (
Kill the following balanced expression (
kill-sexp). See Expressions with Balanced Parentheses.
Kill through the next occurrence of char (
Kill up to, but not including, the next occurrence of char.
One of the commonly-used kill commands is C-w
kill-region), which kills the text in the region
(see The Mark and the Region). Similarly, M-w (
the text in the region into the kill ring without removing it from the
buffer. If the mark is inactive when you type C-w or M-w,
the command acts on the text between point and where you last set the
mark (see Operating on the Region).
Emacs also provides commands to kill specific syntactic units: words, with M-DEL and M-d (see Words); balanced expressions, with C-M-k (see Expressions with Balanced Parentheses); and sentences, with C-x DEL and M-k (see Sentences).
The command M-z (
zap-to-char) combines killing with
searching: it reads a character and kills from point up to (and
including) the next occurrence of that character in the buffer. A
numeric argument acts as a repeat count; a negative argument means to
search backward and kill text before point. A history of previously
used characters is maintained and can be accessed via the
M-p/M-n keystrokes. This is mainly useful if the
character to be used has to be entered via a complicated input method.
A similar command
zap-up-to-char kills from point up to, but
not including the next occurrence of a character, with numeric
argument acting as a repeat count.