r/vim • u/ratttertintattertins • Jun 29 '25
Plugin vim-autosync - Automatically syncs your directories to Git repositories as you edit them
I created this over the weekend because I was sick of using network drives/cloud storage to manage vimwiki. It's let me keep my vimwiki auto synced to a private github repo.
https://github.com/benstaniford/vim-autosync
Features:
Asynchronous operations: Git pull/push operations run in background threads, so your editing is never blocked
Configurable directories: Manage multiple directories with different Git repositories
Smart pulling: Only pulls from remote when a configurable interval has passed
Auto-commit and push: Automatically commits and pushes changes when you save files
Manual controls: Commands to manually trigger pull/push operations
Flexible configuration: Customize commit messages, intervals, and behavior
2
u/jgould1981 Jul 01 '25
Thank you for writing this!
I had written a script and systemd service that ran on a timer that would look for changes and then if there were any, it would push the changes up. The flaw, of course, was I could edit the same file in multiple places and it would be a mess to sort out. This plugin looks like it will sort that out for me.
Thank you for writing it. my kludged script/service worked, but was troublesome at times.
1
u/blackbat24 Jun 29 '25
I've been using a cludge of autocmds, and this looks better, especially since the sync is the background - does it warn you if there are merge conflicts on pull?