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

Support XDG Base Directory Specification #389

Open
erikw opened this issue Oct 27, 2021 · 1 comment
Open

Support XDG Base Directory Specification #389

erikw opened this issue Oct 27, 2021 · 1 comment

Comments

@erikw
Copy link

erikw commented Oct 27, 2021

First of all, thanks for this really great plugin. It's not possible to program workout vi-like keybindings!

Background

Lately the XDG Base Directory Specification has been gaining quite a steady popularity, even though it's been around for a long time already. The basic idea is to standardize where programs put their files e.g. all config files in a certain directory. The benefits for end users are many, including:

  • No polluted $HOME/
  • Can easily grep for only config files in $XDG_CONFIG_HOME
  • Can decide where to store configurations in more complex setups (multi system setup e.g.)
  • Easily wipe state by removing $XDG_STATE_HOME or even $XDG_DATA_HOME, but without destorying and configuration files.

The first point is maybe what most end users enjoy the most though.

How

Specifically for this project, this should mean that the search for the configuration file should be done like:

  1. If $XDG_CONFIG_HOME is set, look for $XDG_CONFIG_HOME/xvim/xvimrc
  2. If $XDG_CONFIG_HOME is unset, use the default value for the envvar which is $HOME/.config. Thus, the config file to look for is at $HOME/.config/xvim/xvimrc
  3. If none of the above, fall-back to current legacy $HOME/.xvimrc

The first two steps to can be codifed in bash like:
${XDG_CONFIG_HOME:-$HOME/.config}/xvim/xvimrc

@r-plus
Copy link
Member

r-plus commented Nov 3, 2021

idea is nice but I think configure environment variable for GUI application (Xcode) is not easy.

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

No branches or pull requests

2 participants