Kill Entire Line with Prefix Argument19 Oct 2014, by Artur Malabarba.
Emacs.SE Lessons post series
I won’t repeat myself on the usefulness of prefix arguments, though it would hardly be an overstatement. Killing 7 lines of text in two keystrokes is a bliss most people will never know.
Today's post was prompted by this question on Emacs Stack Exchange. Itsjeyd has
grown tired of using 3 keystrokes to kill a line (C-a C-k
C-k) and asks for an alternative. The straightforward answer is to use
kill-whole-line instead, but then you either need another keybind,
C-S-backspace, or you need to lose the regular
The solution I've found for myself is to use prefix arguments.
You see, killing half a line is a useful feature, but slaughtering three and a half lines make very little sense. So it stands to reason to have
meticulously murder everything in its sight when given a prefix argument.
And we bind them, of course.
With this little macro, C-k still kills from point, but
C-3 C-k swallows three whole lines. As a bonus, we get the
kill-whole-line behavior by doing C-1 C-k.
Are there any other functions which might benefit from this macro?