This sets up an autocommand group, and removes any previous handlers (via the autocmd!
这会设置一个自动命令组,并删除所有之前的处理器(通过autocmd!
To see the complete list of these events, type: help autocmd-events on the Vim command line.
要查看此类事件的全部清单,在Vim命令行输入:help autocmd - events。
The event name is one of the 78 valid Vim event names (as listed under: help autocmd-events).
事件名称是78种有效Vim事件名称(如:help autocmd - events所列示)之一。
The keyword for all this is autocmd (which is often abbreviated to just au). The usual syntax is
所有这些的关键字就是autocmd(通常缩写为 au)。
The filename pattern syntax is similar -- but not identical -- to a normal shell pattern (see :help autocmd-patterns for details).
文件名称模式的语法和普通的shell 模式(详见 :help autocmd-patterns)很相似 ——但又有所区别。
Any autocmd can be specified with a comma-separated list of event types, in which case the handler will be invoked for any of the events listed.
任何autocmd都可以由一个用逗号分隔的事件类型清单指定,这里所列出来的任一事件都能调用处理器。
If you execute the same autocmd twice, you get two event handlers, both of which will be separately invoked by the same combination of event and filename from that point onward.
如果您两次执行相同的autocmd,您就可以获得两个事件处理器,这两个处理器将会由那一点上相同的事件和文件名组合分别激活。
The colon at the start of the command is optional, but it's a good idea to include it; doing so makes the command easier to locate in the (usually complex) argument list of an autocmd.
命令开始处的冒号是可选的,但是最好加上;这么做能够让命令更轻松地在一个(往往很复杂的)autocmd参数清单中定位。
The colon at the start of the command is optional, but it's a good idea to include it; doing so makes the command easier to locate in the (usually complex) argument list of an autocmd.
命令开始处的冒号是可选的,但是最好加上;这么做能够让命令更轻松地在一个(往往很复杂的)autocmd参数清单中定位。
应用推荐