Website of Daniel A. Mayer

(G)vim Hangs While Saving a File When Using Eclim

I had a strange problem with vim on several of my machines. Sometimes, when saving a file (source code or LaTeX) in (g)vim, the vim session would just hang / freeze. After a couple of minutes the file got written and operation resumed as ususal.

Before switching to vim for all my development, I used eclipse for many projects. I like IDEs especially for their code completion functionality. To get this functionality into vim I used eclim which allows the user to code in vim while having vim connect to a backend eclipse instance which provides code completion (among other things).

It turns out that the communication between vim and eclim uses TCP port 9091 which happens to be the same port the bittorrent client transmission uses for its web interface. This port conflict caused vim to hang when it attempted to connect to the eclim instance when saving a file (while transmission was running). Closing transmission or chaning the port of the webinterface solved the issue, but it was somewhat hard to debug. Hope this helps somebody having the same issue.

Comments