vim:xdg: Fix bug that creates ~/~
Fix bug that when the XDG Base Directory variables are not set on startup a directory "~" is created in $HOME instead of falling back to the default values.
This commit is contained in:
@@ -10,13 +10,13 @@
|
|||||||
" - https://github.com/kaleb/vim-files/blob/23ee9d4a97d21f040c63e5c6dfdb72382fada840/xdg.vim
|
" - https://github.com/kaleb/vim-files/blob/23ee9d4a97d21f040c63e5c6dfdb72382fada840/xdg.vim
|
||||||
|
|
||||||
if empty($XDG_CACHE_HOME)
|
if empty($XDG_CACHE_HOME)
|
||||||
let $XDG_CACHE_HOME = '~/.cache'
|
let $XDG_CACHE_HOME = $HOME . '/.cache'
|
||||||
endif
|
endif
|
||||||
if empty($XDG_CONFIG_HOME)
|
if empty($XDG_CONFIG_HOME)
|
||||||
let $XDG_CONFIG_HOME = '~/.config'
|
let $XDG_CONFIG_HOME = $HOME . '/.config'
|
||||||
endif
|
endif
|
||||||
if empty($XDG_DATA_HOME)
|
if empty($XDG_DATA_HOME)
|
||||||
let $XDG_DATA_HOME = '~/.local/share'
|
let $XDG_DATA_HOME = $HOME . '/.local/share'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !isdirectory($XDG_CACHE_HOME . "/vim/swap")
|
if !isdirectory($XDG_CACHE_HOME . "/vim/swap")
|
||||||
|
|||||||
Reference in New Issue
Block a user