On deleting a line in Emacs using C-k, Emacs removes the line contents but it leaves a blank newline character. To remove this, I again press C-k.

How can I delete the complete line with no traces left behind in one shot?


3 Answers 3


From documentation:

kill-whole-line is an interactive compiled Lisp function.

It is bound to <C-S-backspace>.

(kill-whole-line &optional ARG)

Kill current line. With prefix ARG, kill that many lines starting from the current line. If ARG is negative, kill backward. Also kill the preceding newline. (This is meant to make C-x z work well with negative arguments.) If ARG is zero, kill current line but exclude the trailing newline.


Use 1 as argument, for example C-1 C-k or bind to a function that calls (kill-whole-line 1).


Consider adding (setq kill-whole-line t) to your configuration in case you'd want it to be default behavior.

  • This is awesome!
    – Sandra
    Oct 21, 2021 at 8:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.