diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2020-04-25 20:13:01 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2020-04-25 20:13:01 +1200 |
commit | 208a0696b268ab7f0e74a8a0d44e31d966762d5c (patch) | |
tree | e378019036bf2b3d370b85bc3975300ecf73418e | |
parent | Merge branch 'release/v8.20.0' (diff) | |
download | dotfiles-208a0696b268ab7f0e74a8a0d44e31d966762d5c.tar.gz dotfiles-208a0696b268ab7f0e74a8a0d44e31d966762d5c.zip |
Implement specified fallbacks for $XDG_*_DIRS
From <https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html#variables>:
> If $XDG_DATA_DIRS is either not set or empty, a value equal to
> /usr/local/share/:/usr/share/ should be used.
> ...
> If $XDG_CONFIG_DIRS is either not set or empty, a value equal to
> /etc/xdg should be used.
-rw-r--r-- | vim/autoload/xdg.vim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/vim/autoload/xdg.vim b/vim/autoload/xdg.vim index ab756f73..fd7ddedf 100644 --- a/vim/autoload/xdg.vim +++ b/vim/autoload/xdg.vim @@ -13,7 +13,7 @@ function! xdg#ConfigDirs(name) abort \ : '~/.config' let dirs = exists('$XDG_CONFIG_DIRS') \ ? split($XDG_CONFIG_DIRS, ':') - \ : [] + \ : ['/etc/xdg'] return map( \ insert(dirs, home) \,'join([v:val, name], "/")' @@ -27,7 +27,7 @@ function! xdg#DataDirs(name) abort \ : '~/.local/share' let dirs = exists('$XDG_DATA_DIRS') \ ? split($XDG_DATA_DIRS, ':') - \ : [] + \ : ['/usr/local/share', '/usr/share'] return map( \ insert(dirs, home) \,'join([v:val, name], "/")' |