Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

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

:vi

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

You could also do:

:set dir=/dev/shm

:vi

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.