Set correct AppData dir for more Windows versions

Replace the hard-coded path with an environment variable supported by
all versions of Windows since XP.
This commit is contained in:
Dan Grover
2013-03-09 00:54:26 -08:00
committed by Tim Pope
parent e7eda3bb86
commit 41499a5767
2 changed files with 3 additions and 3 deletions

View File

@@ -72,7 +72,7 @@ if !empty(&viminfo)
set viminfo^=!
endif
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'
let s:dir = has('win32') ? '$APPDATA/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