Re: Escaping from BufWritePre ...
- "Andrzej M. Ostruszka" wrote:
>I think it would be easier to write a script (which can be invoked
> Suppose that I want to check my file for some condition before I write
> (and close it) - to be specific let it be spelling check (not my case).
> I've wanted to setup autocommand with BufWritePre event but how can I
> write a function which will check spelling and stop writing in case
> there are errors and let me fix problems? Is it possible?
by a user-defined command, menu item, or button) that does the
"spell-check" and, when all is done, writes the file. If you define the
commands :Write and :WQuit then get into the habit of using :W and :WQ
instead of :w and :wq.
If you really want this to happen by an autocommand, it might be
easier in vim 6.0 than in vim 5.x. You can use the same autocommands
that were introduced to make transparent read/write over a network.
HTH --Benji Fisher