Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify/simplify the config file search across OS versions. ALT: Allow all versions to honor XDG_CONFIG_HOME if set #14786

Open
eldorel opened this issue May 16, 2024 · 2 comments

Comments

@eldorel
Copy link

eldorel commented May 16, 2024

I use multiple operating systems on a daily basis.
At the moment, I have to maintain several different config file layouts/symlinks/etc for each OS due to the inconsistent location assumptions across VIM/GVIM versions.

In my opinion, having separate logic and file locations for each OS is unnecessary and introduces unneeded complexity to the end user experience.
Even the ( frankly silly ) option of having all versions look at all legacy locations would simplify the end user experience.

The new patch allowing the linux/Unix versions to use the XDG variables has the potential to be a huge step toward simplifying that, but Windows (and possibly MacOS) versions do not honor that variable.

Describe the solution you'd like

I would like to see the logic for locating the vim config files made consistent across all versions, so that users can simply pick one location and use it across all of their systems.

$HOME/.vimrc; $HOME/.config/vim/vimrc; etc are all completely valid file locations on all major operating systems and fileystems...

The historical reasons for requiring completely different filenames for the Windows version is no longer present, and modern versions of NTFS/FAT have absolutely no issues with periods in a filename.

Additionally, the myriad of compatibility improvements such as terminal emulation, powershell, compatibility layers such as WSL or cygwin, etc have introduced the ability to have multiple versions of vim in sub-environments on a single device...

End users should not be required to manage symlinks and/or multiple config files in order to have a consistent configuration.

Additional Note

Personally, I just want the windows and MacOS versions to check for the XDG environment variables in exactly the same manner that the current linux build does.
This would allow me to configure a single variable when I initially setup a new system, and simplify the process of maintaining a syncronized vimrc across all of my devices.

However, I feel that rather than implementing a specific fix to allow power users to have the benefit of a consistent configuration, the entire system for handling config file locations needs to be overhauled in order to allow all users to have a more consistent and streamlined experience.

@saccarosium
Copy link
Contributor

XDG environment variables are a Linux spefic. Although on MacOS in the terminal they are use, due to be UNIX . On windows there are other sets of guidelines that should be followed.

@eldorel
Copy link
Author

eldorel commented Jun 13, 2024

XDG environment variables are a Linux spefic. Although on MacOS in the terminal they are use, due to be UNIX . On windows there are other sets of guidelines that should be followed.

Environment variables are trivial to add on all OS's.

Part of why I made the request is because I am using the XDG variables on several windows 10 and 11 systems to configure other cross-platform software, and it was delightfully easy to do.

Then I installed vim on my new laptop, and had to think about where I needed to place all of the different config files so that it works the same way no matter what terminal/environment I execute from.

On the plus side, I found out that setting XDG_CONFIG_HOME in the windows user environment also makes that variable visible from WSL/Cygwin/Wezterm/Powershell/etc...

So now I just have a handful of identical single line .vimrc/_vimrc files with a single 'source' directive that points to the actual config file.

source $XDG_CONFIG_HOME\vim\vimrc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants