Loading ...
Sorry, an error occurred while loading the content.

Re: Escaping from BufWritePre ...

Expand Messages
  • Benji Fisher
    ... I think it would be easier to write a script (which can be invoked by a user-defined command, menu item, or button) that does the spell-check and, when
    Message 1 of 2 , Mar 29, 2001
    • 0 Attachment
      "Andrzej M. Ostruszka" wrote:
      >
      > 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?

      I think it would be easier to write a script (which can be invoked
      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
    Your message has been successfully submitted and would be delivered to recipients shortly.