On 05/09/09 17:40, bill lam wrote:
>
> (typo)
> I found that BufWrite event is _not_ triggered when press :w or :x but
> BufWriteCmd event is triggered instead. Not sure what is the
> difference of these 2 events.
>
See
:help BufWriteCmd
:help Cmd-event
The difference is that if _any_ BufWriteCmd autocommand is defined, Vim
assumes that _that_ command does the actual write, and does not write
the file itself. This is used, for instance, to re-zip a *.gz file after
editing. (A BufReadCmd autocommand will have been used to unzip the same
file [if it already existed] so it can be edited in clear.)
For normal files, don't define a BufWriteCmd (not even to do nothing
else than display the autocommand event name). Use BufWritePre and/or
BufWritePost instead. (BufWritePre can also be invoked as BufWrite, the
two names are synonyms for a single event.)
Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
135. You cut classes or miss work so you can stay home and browse the web.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---