in reply to Re: File::XDG on varying platforms
in thread File::XDG on varying platforms

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

Replies are listed 'Best First'.
Re^3: File::XDG on varying platforms
by NERDVANA (Priest) on May 28, 2025 at 00:25 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
        For someone who has implied he doesn't use Windows, you seem to know rather a lot ;-)

        Heh, well from 1995-2000 I didn't know Linux existed. From 2000-2004 I was using a Windows desktop with Cygwin and "User Mode Linux" (kind of like today's Windows Subsystem for Linux) to run native Linux apps while also running a FreeBSD server to offload persistent things like file shares. It was pretty cool - I had the Cygwin X server and programs running in User Mode Linux could connect to it and render windows right alongside my Windows apps.

        From 2004-2018 I had what I called a "hybrid desktop" where Windows got two monitors and Linux got one monitor and I had a gigabit crossover cable between them for my samba shares and used Synergy to let my mouse roam from one monitor to the other giving me seamless copy/paste between Windows and Linux desktops. I no longer needed much from cygwin because a full half of my desktop was actual Linux and all the files of any importance were on Linux. By the end of that, Windows had 2 monitors and Linux had 4 monitors, since almost everything was browser-based, and my laptop was linux-only, and even the Windows half was a dual-boot with Linux.

        I was also doing quite a lot of software to support Windows in the 2007-2011 years, and from 2015-2022 I was sysadmin for a Windows Server, so I had to keep dealing with it even if my workstation was migrating away from it.

        In 2018 I had found Linux substitutes for pretty much every Windows app I previously needed for work, and switched to using Linux as my daily driver and only booting into Windows to play games. So at that point, I was no longer customizing Windows for development work, or at all, really, since I don't care what the experience is like for the few minutes it takes me to open a video game.

        When Windows 11 came out and started spamming me with advertisements and latest gossip-news and giving me Bing results when I was trying to search for Control Panel applets, I spent a few hours researching how to turn all that off permanently by uninstalling Windows components. When it all came back the next month because MS helpfully re-installed all those components without my permission, I decided I was done with it forever to the greatest degree possible. I do still have my dual-boot with windows 11, kept for the sole purpose of playing StarCraft II which I can never get to run reliably in Wine, but I haven't had time to play in nearly a year, so that's pretty much the end of Windows for me. ...with the exception that I do have a VM with Windows 10 so that I can test my published cpan modules on Win32. Also my wife still has a windows laptop, so it's never totally gone.

Re^3: File::XDG on varying platforms
by jo37 (Curate) on May 28, 2025 at 20:39 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$