diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2020-05-16 01:22:22 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2020-05-16 01:29:15 +1200 |
commit | 516eea5f36f9d565014c23d8e0b10b43191aedce (patch) | |
tree | b643ed31876f631cbbf37257e334ebf4ab268763 /vim/autoload | |
parent | Simplify Vim XDG subdir definition (diff) | |
download | dotfiles-516eea5f36f9d565014c23d8e0b10b43191aedce.tar.gz dotfiles-516eea5f36f9d565014c23d8e0b10b43191aedce.zip |
Switch XDG semantics to functions not global var
Diffstat (limited to 'vim/autoload')
-rw-r--r-- | vim/autoload/xdg.vim | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/vim/autoload/xdg.vim b/vim/autoload/xdg.vim index e0230b60..c5737506 100644 --- a/vim/autoload/xdg.vim +++ b/vim/autoload/xdg.vim @@ -40,16 +40,22 @@ function! s:Dirs(name) abort \) endfunction -let xdg# = { - \ 'cache': { - \ 'home': s:Home('XDG_CACHE_HOME'), - \ }, - \ 'config': { - \ 'home': s:Home('XDG_CONFIG_HOME'), - \ 'dirs': s:Dirs('XDG_CONFIG_DIRS'), - \ }, - \ 'data': { - \ 'home': s:Home('XDG_DATA_HOME'), - \ 'dirs': s:Dirs('XDG_DATA_DIRS'), - \ }, - \} +function! xdg#CacheHome() abort + return s:Home('XDG_CACHE_HOME') +endfunction + +function! xdg#ConfigHome() abort + return s:Home('XDG_CONFIG_HOME') +endfunction + +function! xdg#DataHome() abort + return s:Home('XDG_DATA_HOME') +endfunction + +function! xdg#ConfigDirs() abort + return s:Dirs('XDG_CONFIG_DIRS') +endfunction + +function! xdg#DataDirs() abort + return s:Dirs('XDG_DATA_DIRS') +endfunction |