Running without major issues for a week now so I'm adding this as an alternative answer.
I tried all suggestions made here and wherever I could find and the only thing that effectively worked in skipping accessing my networked homefolder was using gvim --clean
.
- Although the help states that
--clean
is equivalent to -u DEFAULTS -U NONE -i NONE
, it is not. Using procmon, it was clear that vim was still accessing my network drive.
- It's not a solution. It's good to troubleshoot but I don't want to work with a clean vim.
I ended up patching the executable to skip the HOME*
environment variables all together.
It did require me to change my $HOME references in my vimrc.local to an absolute path
Tested on vim 8.1.282.0
if the byte sequence is present in your version of vim, I assume it will work as well. You might just as well crash vim but there's little/no harm in trying
search for following bytes
CB 65 00 E8 D1 9B F1 FF 8B E8 83 C4 04 85 ED 74 06 80 7D 00 00 75 7F
68 04 CC 65 00 E8 B8 9B F1 FF 83 C4 04 8B F8
and replace with
CB 65 00 E8 D1 9B F1 FF 8B E8 83 C4 04 85 ED 74 04 80 7D 00 00 EB 7F
68 04 CC 65 00 E8 B8 9B F1 FF 83 C4 04 8B F8
- Original vim's MD5
E6BBB217EAAB09FE6E2C380D4DF09BD3
- Patched vim's MD5
BDAAAC3FA3F6796825A51EF1C0E5B3FD
Description of the patch
Using Ghidra to reverse engineer vim, you can find where references to the HOME*
environment variables get checked. I have relabeled the autogenerated labels in below screenshots as to show what the block of code does in the context of following/skipping the home folders.
I found two code paths that lead to executing the Cullprit
code depending on whether or not the HOME*
environment variables are set. The plan of attack then was to patch the code to always flow to SkipHome

Patch two instructions
- Changed the
74 06 JZ
instruction to 74 04 JZ
so instead of jumping 6 bytes into the Cullprit
code when the $HOME
environment variable is not set, jump to our unconditional JMP
- Changed the
75 7f JNZ
conditional jump to a eb 7f JMP
unconditional jump.

Addendum
That said, vim first checks for a $HOME
variable and only checks for $HOMEDRIVE
and $HOMEPATH
if $HOME
is empty. Windows, afaik, does not set a $HOME
variable out of the box so I assume that is simply a cross platform check.
If you don't want to mess with your existing HOME*
variables and don't want to patch, it looks like you can abuse that fact by setting a $HOME
variable to whatever you like and skip the HOME*
code.
for example setx home <path to your _vimrc>
might just work.
:echo $HOME
and:echo expand("$HOME")
print what you expect? (Just to make sure it is not reset afterwards.) – Ralf Jan 4 '19 at 12:50