Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想多次调用用户定义的命令。这是一个命令定义:
command! -count=2 Delete d
我在命令行中调用命令:
:2 Delete
但是这个调用只删除了一行。所以该命令只被调用一次。
计数不会自动传递给您的自定义命令;你需要通过特殊<count>关键字指定你希望 Vim 插入它的位置,例如:
<count>
command! -count=2 Delete <count>d
见:help <count>。
:help <count>