2011-11-04, Fri

VIM lagging and causing network I/O when moving within a file

Recently, whenever I edit a file in VIM over a samba share or an SSH mapped drive in Windows, there is a noticeable delay as well as an I/O event over the network.

At first, I was advised that it could be VIM writing to the file’s corresponding swap file over the network. I checked that setting, instructed VIM to write swap files to a local folder, and yet the delay and I/O still ensued.

So I went through my VIM plugin files, removing them all, and adding them back one by one. I finally found the culprit in vim-fugitive, a VIM plugin that provides GIT functionality from within VIM. Since I wasn’t using it very much, I disabled it. The lags and IO events disappeared.

For some reason, vim-fugitive seems to read from the opened file every time I move around the buffer.

So there you go, if you find some mysterious lag in your cursor movement, it could be vim-fugitive or some other plugin.

Isaac Su

tags: delay lagging network plugins samba share ssh vim vim-fugitive

---

Comment

  1. Ah, that happened to me recently (fugitive user), though without a network drive, just a glut of IO and vim’s operations ending up serialised at the end of a long long queue.

    For responsive UIs, IO should absolutely be evented, or non-blocking, or outside the UI thread.

    — Dodo · Mar 16, 10:03 PM · #

---
 
---