Updated runtime files.
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
*autocmd.txt* For Vim version 8.0. Last change: 2016 Sep 21
|
||||
*autocmd.txt* For Vim version 8.0. Last change: 2016 Sep 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -79,11 +79,15 @@ exception is that "<sfile>" is expanded when the autocmd is defined. Example:
|
||||
|
||||
Here Vim expands <sfile> to the name of the file containing this line.
|
||||
|
||||
When your .vimrc file is sourced twice, the autocommands will appear twice.
|
||||
To avoid this, put this command in your .vimrc file, before defining
|
||||
autocommands: >
|
||||
`:autocmd` adds to the list of autocommands regardless of whether they are
|
||||
already present. When your .vimrc file is sourced twice, the autocommands
|
||||
will appear twice. To avoid this, define your autocommands in a group, so
|
||||
that you can easily clear them: >
|
||||
|
||||
:autocmd! " Remove ALL autocommands for the current group.
|
||||
augroup vimrc
|
||||
autocmd! " Remove all vimrc autocommands
|
||||
au BufNewFile,BufRead *.html so <sfile>:h/html.vim
|
||||
augroup END
|
||||
|
||||
If you don't want to remove all autocommands, you can instead use a variable
|
||||
to ensure that Vim includes the autocommands only once: >
|
||||
@ -130,8 +134,13 @@ prompt. When one command outputs two messages this can happen anyway.
|
||||
|
||||
:au[tocmd]! [group] {event}
|
||||
Remove ALL autocommands for {event}.
|
||||
Warning: You should not do this without a group for
|
||||
|BufRead| and other common events, it can break
|
||||
plugins, syntax highlighting, etc.
|
||||
|
||||
:au[tocmd]! [group] Remove ALL autocommands.
|
||||
Warning: You should normally not do this without a
|
||||
group, it breaks plugins, syntax highlighting, etc.
|
||||
|
||||
When the [group] argument is not given, Vim uses the current group (as defined
|
||||
with ":augroup"); otherwise, Vim uses the group defined with [group].
|
||||
|
||||
Reference in New Issue
Block a user