What does C-u 0 followed by another command mean in general in Emacs?
For example,
I thought C-k and C-u 0 C-k were the same, but find out that
C-u 0 C-k kill the part of the current line before the cursor, while C-k kill the the part after.
Thanks.
Best Answer
Short answer
It provides number
0
to the next command.Long answer
C-u
in emacs calleduniversal-argument
. It's begin a numeric argument for the following command. Digits or minus sign followingC-u
make up the numeric argument. You can read more details aboutC-u
by typingC-h k C-u
or read online documentation here.Understanding meaning of
C-u
, now you can know that,C-u 0 C-k
andC-k
are not the same. The first,C-k
is called with an numeric argument, it's number zero. The secondC-k
is called alone. It leads to different behavior.From Killing by Lines section of emacs manual: