Is there a configuration I can add to a .vimrc file which will cause vim to run a command when a file is closed?
For instance, suppose I'm editing a file that is under version control. Once I'm done editing I would like a command to commit my changes to be run immediately before vim fully closes without having to run it separately after saving/quiting the file.
I'm curious about this as I have a tendency to forget to commit my changes.
Alternatively and if it is not possible to do what I'm asking, is it possible to configure an internal vim :command that will run the commit from with vim before I close the file?