To type a minus sign with a numeric prefix argument, you can enter the number by typing the digits: C-u 6 4 -
or ESC 6 4 -
or M-6 M-4 -
or C-6 C-4 -
(or a few other combinations). This method doesn't let you abbreviate 4n by typing C-u
n times.
Another method, which also works with a digit, is to use the C-u
prefix, then enter the number, then another C-u
and finally the character. For example C-u 6 4 C-u -
inserts 64 minus signs, and C-u 6 4 C-u 0
inserts 64 zeros. This method doesn't let you abbreviate 4n by typing C-u
n times.
In most cases, an alternative way is to use C-q
before the minus sign, e.g. C-u C-u C-u C-q -
inserts 64 minus signs. However there are a few cases where this is different, such as Overwrite mode, where C-q
inserts instead of overwriting. This method doesn't work for digits (except 8 and 9 when read-quoted-char-radix
is the default octal): you would have to type the digit's octal code (or dec/hex if you've changed the radix), e.g. C-u C-u C-q 6 0 RET
to insert 0000000000000000
.
C-u
, it does work using theC-0
toC-9
characters, for 64 minus signs you can useC-6 C-4 -
(Meta and Control can both be used together with digits to specify the universal argument.)C-q
mechanism described in @shynur's answer is completely general and useful in many places: it's worth remembering. And because of that, I suspect that this is a duplicate question, but I haven't done a search to confirm yet.C-q
, and theC-u
method will not work e.g. withC-u C-u -
: theC-u
does not quote the-
. So it doesn't quite qualify as a duplicate in my book, but thanks for finding it. To some extent, all of these are corner cases, but they do tent to trip people up. Gilles' answer below is the most comprehensive one I have seen.