这是因为 %是一个“ motion 命令”,所以它可以在 vim 期望这样一个命令的任何地方使用。来自 :help y:
["x]y{motion} Yank {motion} text [into register x]. When no
characters are to be yanked (e.g., "y0" in column 1),
this is an error when 'cpoptions' includes the 'E'
flag.
默认情况下,“ item”包括括括号、大括号、括号、 C 样式注释和各种预编译语句(#ifdef等)。
tag char note action in Normal mode
------------------------------------------------------------------------------
|v| v start characterwise Visual mode
|%| % 1 find the next (curly/square) bracket on
this line and go to its match, or go to
matching comment bracket, or go to matching
|d| ["x]d{motion} 2 delete Nmove text [into buffer x]