I'd like to accomplish the following goals:
Whenever I perform a writing file action in Vim, like
:w
, I'd like to add the snapshot of that file to the staging area and commit it to the local repo, just like I manually execute the commandsgit add file.name && git commit -m 'some msg'
.The local repo is not a problem, I'll initiate it manully, or better this vimscript will initiate the repo automatically for me when necessary.
How can I do this? Please advice, thanks!