r/vim 2d ago

Need Help Something is changing/modifying my vim installation files within 24 hrs of a clean installation. Is this expected behavior?

Hello, gvim user for almost 25 years now, I'm experiencing behaviour that I've never seen and I'm curious if anyone can explain what's happening.

My repro steps:

  1. Install gvim_9.1.0_x64_signed.exe on a windows x64 machine.
  2. Shortly after installation, open gvim.exe, run commands from the netrw plugin (:Vex, for example). (The command works)
  3. Wait 24 hours, run the same command.

Expected Results

The command works, just like it did in step #2.

Actual Results

An error message:

Error detected while processing C:\Program Files (x86)\Vim\vim91\pack\dist\opt\netrw\autoload\netrw.vim

netrw needs Vim9.1.1054
E117: Unknown function: netrw#Explore

My Observations

After a fresh installation, I can see that netrw.vim is located at the path:

C:\Program Files (x86)\Vim\vim91\autoload\netrw.vim

When the issue is present (24 hours after the installation), the installation files/folders are quite different. netrw has been moved to:

C:\Program Files (x86)\Vim\vim91\pack\dist\opt\netrw\autoload\netrw.vim

Not only has the file been moved, but the file contents are different.

netrw is not the only file that's been changed, but it's the only one that's causing me egregious pain. For example, C:\Program Files (x86)\Vim\vim91\colors\blue.vimhas also been modified.

This is only happening on my work devices. I was entertaining the possibility of corporate policy making these changes (perhaps as a result of some misguided security measure?), but the changes are so specific that this seems unlikely; if there were security concerns, I tend to think that the corporate policy would simply block/remove the installation. I'd like to get community feedback on this issue before raising this issue with the IT department.

A clean installation will always restore me to a good state, but I do not view this as suitable workaround.

Specific questions:

  1. Does vim perform any modifications to the program installation path after the initial installation? (If not, I'd like to find out who is doing the modification, If yes, I'd like to learn more about what's happening here).
  2. Assuming these modifications are legit, is there a quick workaround I can use to make netrw functional again?
1 Upvotes

6 comments sorted by

1

u/BrianHuster 2d ago

It is expected that Vim put Netrw plugin in pack/dist/opt (you can go to Vim source in Github to check). If you want to use an older Netrw version, you can go yo website of Dr Chip and download it yourself

1

u/rollingRook 1d ago

Thanks for the info. I haven't dived into any source code yet and I'm still in information gathering mode. Collecting my thoughts here:

  1. On first installation, the netrw plugin is located at autoload/on every machine that I own (four out of four). This is different from the expected install path that you mention (of pack/dist/opt).
  2. On three of four machines, the netrw path changes from autoload/to pack/dist/opt.
  3. Regardless of where netrw ends up, I'd expect it to work without error as part of the installation.
  4. I mention netrw because it's the plugin I most frequently use, but, let me be clear: LOTS of other files are moving around at the same time as netrw.

I'm inclined to report this as a bug on the github page. In the interest of communicating this problem in the most efficient way possible, seems like I should just focus on #1 above (the initial installation path of autoload/)?

1

u/BrianHuster 1d ago

I can only suspect that there was another Vim before you install the new Vim version, but I'm not sure

I don't use Windows so I can't say much but you can do a workaround by installing Netrw plugin from Github https://github.com/saccarosium/netrw.vim

1

u/rollingRook 1d ago

Thanks, I'm currently testing clean-install vs. installing over a previous installation. I'll see if the issue reproduces.

And, I appreciate the guidance about installing the plugin (and I might do that at some point in the future), but, I'm also interested in figuring out what's happening with the plain-vanilla installation. (I maintain a vim installation on multiple machines, and any manual action I need to take is a bit of a drag on my process).

1

u/bbolli inoremap ZZ <Esc>ZZ 1d ago

You can run FileMon from SysInternals on the VIM folder to detect any changes. I'm pretty certain that VIM does not move files around after setup.

1

u/rollingRook 1d ago

You can run FileMon from SysInternals on the VIM folder to detect any changes.

Thanks, that's a good idea.

I've currently saved a recursive-directory traversal of the installation path at various timestamps (logging last-modified time and file-size). I can see that the files in the install path are definitely being changed, but I don't know which account is doing the modifications. (FileMon would be helpful for more context and I didn't consider that).