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 (
backward-kill-sentence). See Sentences.
Kill to the end of the sentence (
Kill the following balanced expression (
kill-sexp). See Expressions.
Kill through the next occurrence of
M-x zap-up-to-char char
Kill up to, but not including, the next occurrence of
One of the commonly-used kill commands is
kill-region), which kills the text in the region (see Mark). Similarly,
kill-ring-save) copies the text in the region into the kill ring without removing it from the buffer. If the mark is inactive when you type
M-w, the command acts on the text between point and where you last set the mark (see Using Region).
Emacs also provides commands to kill specific syntactic units: words, with
M-d (see Words); balanced expressions, with
C-M-k (see Expressions); and sentences, with
C-x DEL and
M-k (see Sentences).
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-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.