This is really weird. Everytime I type in the insert mode I hear the sound of disk access. And this is not the case with gedit. My system is ubuntu 10.10. Any idea?
2 Answers
It's probably the swap file. To find the name of the swap file being used for the current Vim buffer, execute
:swapname
Then, to test whether that file is being modified with every keystroke, you could open another terminal window and execute
$ watch ls -l swapfile
where swapfile is the file name returned by the :swapname
command above. Then watch the file's modification time as you type into Vim.
BEGIN EDIT: Having tried the above, I see that ls -l
doesn't have sufficient resolution and the default 2-second sample interval of watch
is a little long. A better command to see the modification time of your swap file changing is this:
$ watch -n 1 stat -c "%y" swapfile
END EDIT
The time between updates of the swap file is set by the 'updatetime' option, whose value in milliseconds you can determine by executing
:set updatetime?
Unfortunately, that same timer is used to trigger CursorHold autocommands and some plugins set 'updatetime' to around 100 milliseconds to respond quickly after user keystrokes. If you find that 'updatetime' has a value less than its default of 4000, you could execute
:verbose set updatetime?
to find out where it is being set. Then you can decide whether the feature provided by whatever plugin is setting it is worth the annoyance of continual disk accesses.
-
You rock!! I followed your instruction and it was buftabs plug-in that caused the problem. I checked their site and the new fixed version was uploaded yesterday. Nice timing!– AliceApr 12, 2011 at 13:19
You probably have your disks setup wrong. Any activity in vim will update the swap file, but this information should not be flushed to disk except periodically. The default disk and vim configuration in 10.10 should not cause this behavior, so you should reconsider any optimizations you made to your system config.
.swp
file?