# kill-line(2)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

kill-line - Delete all characters to the end of the line

## SYNOPSIS

n kill-line (C-k)

## DESCRIPTION

kill-line, when used with no argument n, deletes all text from the cursor to the end of a line, the end of line character is NOT deleted. The deleted text is placed in the kill buffer, see yank(2) for more information on the kill buffer. If the line is blank then the whole line is deleted, including the end of line character.

If a positive argument n is supplied the specified number of lines are deleted. If a negative argument is specified the previous -n lines are deleted. If n is `0` the command has no effect.

## NOTES

If a line is accidentally removed then use yank to restore the text or use undo(2).

The Emacs Key binding for kill line ((C-k) ) may be re-bound to affect the behavior of the command.

    ; MicroEmacs binding. Bind to kill the end of line character
    1 global-bind-key kill-line "C-k"

    ; GNU Emacs binding. Bind to leave the end of line character
      global-bind-key kill-line "C-k"

## HISTORY

The behavior of kill-line was modified in November 2004. kill-line now interprets the numeric argument n in both a positive and negative direction. The existing implementation did not operated in a negative direction, the negative argument controlled the kill buffer behavior of the line. The kill behavior is no longer an option to kill-line and the line(s) are always added to the kill buffer, control of the kill buffer is required then deletion should be performed with kill-region(2).

The behavior of the end of line kill used to be controlled by a line(2m) mode, this behavior may be replicated by modification of the binding as described in the previous section.

## SEE ALSO

forward-kill-word(2), global-bind-key(2), kill-paragraph(2), kill-region(2), undo(2), yank(2).

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>