tldr: I have read and followed https://stackoverflow.com/questions/2103968/gvim-runs-very-slowly-when-editing-files-on-a-windows-share but none of the suggestions worked.
I've been using Vim 8.1 on Windows for about 10 years, but since a few weeks ago it became basically unusable. Every single opening or saving of a file on a shared directory takes 15-20 seconds no matter what. The files I work on are usually R scripts of a few dozen lines. Here's what I tried so far:
First, I moved my _vimrc to C:/Users/myuser/_vimrc
. Started vim, and sure enough, it couldn't source _vimrc any more (just to make sure it wasn't reading from someplace else; this _vimrc dated from 2021).
Then, I added the VIMINIT
environment variable with these contents: source $USERPROFILE/_vimrc
. Started gvim, and all settings were back. So that worked.
Next I added this at the top of _vimrc, as suggested:
set directory=C:/Users/myuser
set backupdir=C:/Users/myuser
set viminfofile=C:/Users/myuser/_viminfo
let $HOME=$USERPROFILE
set noswapfile
I didn't do anything about the vimfiles
directory because I don't seem to have one. And since during the actual editing there are no delays, I don't think this has to do with MatchParen setting.
Anyway, everything takes ages. Needless to say that Notepad opens and saves files in a blink.
This is vim 8.1 on Windows 10 Enterprise, build 19045.4291. Administered by somebody else at corporate. I have no admin access.
[EDIT] Vim 8.1 is less than 10 years old. Doesn't matter. I installed it several years ago, never updated it, and haven't had issues until recently.
:set nofsync
but it's a risk.