mirror of
https://github.com/tpope/vim-sensible.git
synced 2025-11-12 13:03:47 -05:00
Honour $XDG_DATA_HOME for &directory setting
'~/.local/share' is only the fallback location for data files, see http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
This commit is contained in:
@@ -68,7 +68,7 @@ if &history < 1000
|
||||
endif
|
||||
set viminfo^=!
|
||||
|
||||
let s:dir = has('win32') ? '~/Application Data/Vim' : match(system('uname'), "Darwin") > -1 ? '~/Library/Vim' : '~/.local/share/vim'
|
||||
let s:dir = has('win32') ? '~/Application Data/Vim' : match(system('uname'), "Darwin") > -1 ? '~/Library/Vim' : empty($XDG_DATA_HOME) ? '~/.local/share/vim' : '$XDG_DATA_HOME/vim'
|
||||
if isdirectory(expand(s:dir))
|
||||
if &directory =~# '^\.,'
|
||||
let &directory = expand(s:dir) . '/swap//,' . &directory
|
||||
|
||||
Reference in New Issue
Block a user