突然想到evil用户不用按C-u,按1就行

众所周知,在evil的normal state下,一个命令如果接受一个数作为prefix-arg,我就按1 2 3,如果它接受一个“是否要那样那样执行这个命令”的prefix-arg,我就按C-u或者SPC u之类的。

突然想到对于后者也可以按1,不管这个数字是多少,反正prefix-arg被置为“是”了。而1C-u SPC u都更好按。

https://www2.lib.uchicago.edu/keith/tcl-course/emacs-tutorial.html

C-u by itself, without any subsequent digits, is equal to a numeric argument of 4. Another C-u multiplies that by 4 more, giving a numeric argument of 16. Another C-u multiplies that by 4 more, giving a numeric argument of 64, etc. For this reason C-u is called the universal-argument .

众所周知 Emacs 的惯例按 C-u 相当于给参数 4

一直不明白,为啥C-u是4?

因为从最早的 TECO Emacs 就是这样了。

from AIM-447 (An Introduction to EMACS Editor)

简单來讲 C-u 会把当前 universal arg 乘 4,这样多按几下就能生成比较大的数了,对当时的 VT100 terminal (80×24)來讲 C-u C-u C-n 向下 16 行就是大半页多了。

简单论证 4 比 3 或 5 更合理。

5 个赞