in reply to File::XDG on varying platforms

Doesn't this depend on vim? e.g. if you have Cygwin's vim, then it would look in the paths reported by cygwin perl, right? And if you have a native Win32 MinGW build of vim, then it would look where Strawberry is indicating?

Replies are listed 'Best First'.
Re^2: File::XDG on varying platforms
by Intrepid (Curate) on May 27, 2025 at 22:15 UTC

    That's a perceptive question, NERDVANA. I didn't detail that I use both kinds of vim on this computer: the Cygwin build for the console/term, and the Win32 build (GVim) for a gui vim. And fortunately both vims look for the personalization config file in $HOME/.vimrc. So I only have to maintain one .vimrc file, because I break some rules by setting $HOME in Cygwin (.bashrc) to $USERPROFILE =~s{\\} {/}g (pseudocode) (C:/Users/somia). That lets me have just one home directory (not ~ equals /home/somia for Cygwin), and I don't have to struggle with trying to remember which & where when I'm looking for files. So the single .vimrc file is at C:/Users/somia/.vimrc.

    I could attempt to edit .vimrc with perl code in this script (note the revised script under "EDIT" in my post), but that just seems like too much work and worry (about messing up a precious config file because I'm not expert enough as a Perl coder - yet).

    We got a little bit off-topic here, but I'm glad you asked, Cheers.

    May 27, 2025 at 22:15 UTC

      Interesting. So vim doesn't respect the %APPDATA% on windows anyway. If I were using windows, I think I'd prefer my config files for things like vim to live inside C:\Users\<your user profile>\AppData\Roaming (which I believe is the default for %APPDATA%), so that in cases where I was logging into a domain it would carry across to wherever else I logged in. You might consider adding symlinks around so that this happens. Or just let all the cygwin tools dump files into the root of your user directory if you like...

      But also, I think you want the home directory on cygwin to be /cygdrive/c/Users/somia so that cygwin tools don't get confused by "C:".

        NERDVANA wrote:
        ...But also, I think you want the home directory on cygwin to be /cygdrive/c/Users/somia so that cygwin tools don't get confused by "C:".

        Again, perceptive. Yeah, some things would probably be easier, but the vast majority of Cygwin-provided tools work just fine with mixed or "hybrid" absolute paths using a volume letter and colon and slashes instead of backslashes, like C:/Users/somia. One cygwin tool that does break is GnuPG (gpg), so with cpan or its competition, I cannot verify download CPAN packages that have been uploaded with a verifying-key. It's something I'd like to have working but not very important in my big picture.

        If I set up another Windows system I will probably try using the unix-style pathname for my home directory. At this point I've got a lot of things that might break if I changed to that.

        And, yes, %APPDATA% is set to C:\Users\somia\AppData\Roaming by default. The person who wrote File::XDG apparently did not want to use the Roaming, but instead chose Local.

        For someone who has implied he doesn't use Windows, you seem to know rather a lot ;-)

        May 28, 2025 at 02:45 UTC

      Had similar issues with vim/gvim from Cygwin, WSL and Windows GVim. Cannot exactly remember the solution I found, but I think it was a Cygwin symlink from one expected location to the other.

      Luckily I went out of [Windows] business, so I cannot tell.

      Greetings,
      🐻

      $gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$