Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using gvim 7.2 on Windows XP to edit files on a slow USB memory stick. When other programs are accessing the stick, the editor freezes for several seconds at a time.

I have already tried using the "set directory" command to move the Vim swap files to the hard disk. Why is gvim accessing the disk while I'm editing, and what can I do to prevent these freezes?

Update: Using process monitoring tools, I found that the freeze occurs when gvim checks whether file is changed when the window gains focus. Is there anyway to turn that off?

share|improve this question

It could be gvim's autoread feature, which checks files being edited for changes made outside gvim. You can control this feature. See the relevant portion of the gvim FAQ.

share|improve this answer
Great suggestion! Sorry that's not it -- autoread is turned off by default and I have confirmed that it is off. – Steve Hanov Sep 4 '10 at 13:57

I would think this is due the the .filename.swp file vim reads and writes from in the same directory as the file you are editing.

To get around this, you can do:

:set dir=/tmp


This assumes that /tmp is fast (and not on the flash drive).

You could also do:

:set dir=/dev/shm


If your entire system is running out of flash, however, you will not get any recovery option after a system crash.

You could also put this in your .vimrc on a system booting/running from flash:

set dir=/dev/shm

share|improve this answer
This is still seen on vim 7.4, Windows 7 professional. Above things did not help :( – nac Aug 18 '15 at 7:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .