Inotify
Basics
Watch for changes recursively
Auto git commit
inotifywait —quiet —monitor —event CLOSE_WRITE —format “git commit —message ‘autocommit on change’ %w” file.txt | sh
Wokring with vim and neovim
source: https://stackoverflow.com/a/7591588 (last comment) vim by default will copy the original file as a backup and will write to a new file resulting in rename and remove (delete self) to get around this force vim to write to original file vim -> set backupcopy=yes neovim vim api -> opt.backupcopy=“yes”
inotifywait -rm -e modify -e move -e delete -e create files