vim: (WIP) Fix severe bugs in synchronization code