WIP: extract vim sync code out of merlin.py