I have a function which performs validity checking on the current file (so as to conform to my employer's coding standards). I would like to call this function before saving, i.e. using BufWritePre. However, I would to prevent saving the file if it fails my checking function.
So, is it possible to break out of the BufWritePre autocommand?
I realise that I could accomplish this by re-mapping the :write
command as illustrated here, but I would like to avoid that if at all possible, as it feels somewhat un-subtle.
Thanks in advance for your suggestions.