Christian Brabandt
unread,Mar 15, 2018, 11:53:56 AM3/15/18Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to vim...@vim.org
Bram,
currently the documentation at `:h autocmd` uses an example that does
not work. This:
`:autocmd! " comment`
will try to remove all autocommands for the group '" comment' and return
"E216: No such group or event"
So fix that in the documentation and mention, that a comment char will
be seen as part of the group name.
So please include the following patch:
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 678fb378f..ca48004ec 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -56,6 +56,8 @@ effects. Be careful not to destroy your text.
Add {cmd} to the list of commands that Vim will
execute automatically on {event} for a file matching
{pat} |autocmd-patterns|.
+ Note: A quote character is seen as argument to the
+ :autocmd and won't start a comment.
Vim always adds the {cmd} after existing autocommands,
so that the autocommands execute in the order in which
they were given. See |autocmd-nested| for [nested].
@@ -91,7 +93,8 @@ will appear twice. To avoid this, define your autocommands in a group, so
that you can easily clear them: >
augroup vimrc
- autocmd! " Remove all vimrc autocommands
+ " Remove all vimrc autocommands
+ autocmd!
au BufNewFile,BufRead *.html so <sfile>:h/html.vim
augroup END
@@ -145,6 +148,8 @@ prompt. When one command outputs two messages this can happen anyway.
plugins, syntax highlighting, etc.
:au[tocmd]! [group] Remove ALL autocommands.
+ Note: a quote will be seen as argument to the
+ :autocmd and won't start a comment.
Warning: You should normally not do this without a
group, it breaks plugins, syntax highlighting, etc.
Best,
Christian
--
Der Wegreisende glaubt stets, weiter zu sein als der Dableibende.
-- Jean Paul