delete line backwards (Emacs)

Viewed 10229

This is probably basic but I really tried to find the answer. "C-k" deletes from the cursor to the end of the line, but is there an analogous shortcut to delete a line backwards from the cursor point? Best

6 Answers

That's not exactly to the beginning of a line, but you might want to check out the hungry-delete package. Install, then add the following to the init file:

(add-hook 'after-init-hook (lambda ()
  (require 'hungry-delete)
  (global-hungry-delete-mode)))

After that DEL would delete up to the next non-whitespace character, and so would Backspace, but in the opposite direction.

M-0C-k (because C-0C-k doesn't work on my computer).

To delete all blank spaces in the beginning of a line:

M-mM-0C-k.

Related