I would like to set an autocommand that automatically resources the file whenever I save it, as now I am doing something like:
:w | so %
Whenever I save something.
What would be the correct 'event' to do this with? For example:
augroup uncompress
au!
au (BufWritePre? BufWritePost? BufWrite? BufWriteCmd? FileWritePre? etc.) *.vim :so %<CR>
augroup END
What is the main difference between BufWrite
and FileWrite
? From the docs it seems pretty similar:
BufferWritePre starting to write the whole buffer to a file
FileWritePre starting to write part of a buffer to a file