Monday, August 10, 2020

Re: How can I find what is touching the timestamp of every file I open with vim

On Mon, Aug 10, 2020 at 10:38 AM John Sellers <johnksellers@gmail.com> wrote:
>
> For unknown reasons, every time I open a file with Windows 10 Gvim (installed in C:\Program Files (x86), the timestamp displayed by Windows is touched for the file I open with Gvim. I've checked both text and binary diffs, including the metadata file wrapper and nothing but the timestamp itself is changed. I think this means it is not a virus. However, it can cause me to lose some data when syncing as an older version of the file could be thought to be the newest version.
>
> Thanks to the wonderful vim.fandom.com site I discovered :scriptnames and so I easily checked all the scripts I may have touched and this is not the problem.
>
> I went back and checked my vim install and found I had an old vim72 and gvim72 version installed. They didn't have uninstalls except uninsal.exe which only cleaned up the windows registry and small stuff and the uninsal.exe just directed me to delete the zip directory I originally used to install. But it may have left some artifacts because after reinstalling vim-win32-installer for vim82 from vim.org, the problem still persisted.
>
> As for other possibilities, in my imagination, I wondered if new aggressive Windows Edge might be somehow lifting its leg on me because it unsuccessfully tried to keep me from re-installing vim as my default editor by locking me into going to the Microsoft store when trying to set the File Type, and I was shocked to see that C:\Program Files (x86)\Vim\_vimrc is has been strongarmed into being a DOS file for Christ Sake. As you know, that doesn't work with my Cygwin bash scripts until I set ff=unix in _vimrc.
> (BTW this problem only started a week or two ago after a number of Windows Updates... coincidence?)
>
> SO HERE IS MY QUESTION
> Is there any way to identify what in Gvim touches my files when I open them with Gvim? And alternatively, if that doesn't work, is there any way to see if Windows is messing around with me without installing a bunch of administrative tools? Maybe there are some logs if I knew where to look.
>
> The only information I've been able to get so far is the observe that opening the file with Gvim at that exact moment changes the timestamp, which I can see happening by watching the directory where the file is by using a MS File explorer window.
>
> Any clues about how I can fix this will be greatly appreciated.
>
> Thanks ahead of time, JS

With a file whose datestamp is not important to you, first display
that timestamp, then try

gvim --clean -R filename.ext
(with two dashes before clean and one before R; it means "edit the
file readonly with only Vim's own default settinigs as set by the
defaults.vim script")
then when gvim has opened the file
:q
(i.e. "quit"), followed by Enter, to close it. Has the timestamp
changed? If it hasn't, then one or more of your customizations (vimrc,
plugins, whatever) is doing something with your file's timestamp. If
it has, then it might be Windows, but I'm not sure.

Oh, and BTW which version of gvim are you using?
:intro
will give you the short answer to this question, and
:version
will give you the long answer.

Best regards,
Tony.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXuFMQo3i-52az0bUMT%2BOB1WTOC00cc2tUzQmtNU3Jf-mw%40mail.gmail.com.

No comments: