I got around to quite a bit of experimenting today, and I am getting inconsistent results. I apologize, but I didn't set up a case testing scenario to clearly and unambiguously sort out the behavior.
My test-beds for gvim --clean -R filename and gvim filename in Powershell.
In Windows 10 the user interface was used.
- & "C:\Program Files\Vim\vim82\gvim.exe" --clean -R C:\Users\johnk\atestfile.txt (powershell)
- & 'C:\Program Files\Vim\vim82\gvim.exe' C:\Users\johnk\atestfile.txt (powershell)
- Gvim 8.2 icon>> Click>> File>> Open...>> select file>> Open
- Gvim Read only 8.2 icon>> Click>> File>> Open...>> select file>> Open
- Open File Browser on Directory>> select file>> left click>> mouse right click>> Edit with Vim
I did find differences in behavior ( e.g. changed the modify time stamp or didn't) when:
- Different ways were used to open with the full script set
- Different directories were used.
- Difference between Powershell command line and windows interface behavior
- Behavior tended to be consistent in streaks and then sudden flip.
- Various scenarios tended toward modifying the time stamp more than others.
- Using --clean -R touched the file sigificantly less often, but there were scenarios in which it always touched the file.
Only the
& "C:\Program Files\Vim\vim82\gvim.exe" --clean -R C:\Users\johnk\atestfile.txt had the reduced script set. The Gvim Read only 8.2 icon seemed to use the same scripts as most of the other Gvims.
The reduced set of --clean -R scripts as reported by :scriptnames were:
- 1: C:\Program Files\Vim\vim82\defaults.vim
- 2: C:\Program Files\Vim\vim82\syntax\syntax.vim
- 3: C:\Program Files\Vim\vim82\syntax\synload.vim
- 4: C:\Program Files\Vim\vim82\syntax\syncolor.vim
- 5: C:\Program Files\Vim\vim82\filetype.vim
- 6: C:\Program Files\Vim\vim82\menu.vim
- 7: C:\Program Files\Vim\vim82\autoload\paste.vim
- 8: C:\Program Files\Vim\vim82\ftplugin.vim
- 9: C:\Program Files\Vim\vim82\indent.vim
- 10: C:\Program Files\Vim\vim82\scripts.vim
- 11: C:\Program Files\Vim\vim82\ftplugin\text.vim
The additional scripts for the other gvim choices were picked from:
- C:\Program Files\Vim\_vimrc
- C:\Program Files\Vim\vim82\*.vim (and subdirectories)
Since there are over a thousand .vim files in the mentioned subdirectories, one can always find what was actually loaded with :scriptnames
The other day I tried some debugging without much success I wasn't able to narrow things down much. I don't know enough to know how to drill down with this, maybe some of you might do better>
- :set verbose= (runs from 0 to 15)
- :set verbosefile=filename
- :breakadd filename (script)
- :debug CommandNmae
- :debug function(arg)
Possible causes of the problem behavior may be:
- due either to Windows or Gvim
- behavior of ".' as apposed to $HOME
- script errors such as indent .vim file not being found (not seen except in logs)
- who knows? Only my guesses.
But I am willing to bet that when the reason is found it will be Windows. I have seen several cases of sloppy programming during this little sojourn.
For example, 3+ color controls for Powershell including terminal color config, local categorical color control, text types by color, patched modifications of particular behavior, and system color settings with apparently independent uncoordinated and unsystematic behavior among all of them touching Powershell.
Now I am an old fogey and I am near my limit. In bringing Windows up to date I had to install the nefarious Microsoft Edge, which is driving me nuts. So in a few days I am going to roll back my computer and delay installing Microsoft Edge until at least October before Microsoft puts the arm on me. Unfortunately after that I will not have an untouched vanella Windows and Gvim environment to test in.
So excuse me if I fade into the woodwork at that time.
Sincerely, JS