diff options
-rw-r--r-- | vim/vimrc | 26 |
1 files changed, 12 insertions, 14 deletions
@@ -138,8 +138,6 @@ let $MYVIM = option#Split(&runtimepath)[0] " defaults, using autoloaded xdg# functions. " if has('unix') - let s:xdgcachehome - \ = xdg#CacheHome() let s:xdgconfigdirs \ = xdg#ConfigDirs() let s:xdgconfighome @@ -193,12 +191,12 @@ endif " v8.1.716 introduced a way to set this with an option named 'viminfofile', " but I don't see a reason to use that. " -if exists('s:xdgcachehome') && s:xdgcachehome !=# '' - if !isdirectory(s:xdgcachehome) - call mkdir(s:xdgcachehome, 'p', 0700) +if exists('s:xdgstatehome') && s:xdgstatehome !=# '' + if !isdirectory(s:xdgstatehome) + call mkdir(s:xdgstatehome, 'p', 0700) endif execute 'set viminfo+='.option#Escape( - \ 'n'.s:xdgcachehome.'/viminfo' + \ 'n'.s:xdgstatehome.'/viminfo' \) endif @@ -243,12 +241,12 @@ set history=300 " 'backupfullname', 'swapfilefullname' would have been clearer. " set backup -if exists('s:xdgcachehome') && s:xdgcachehome !=# '' - if !isdirectory(s:xdgcachehome.'/backup') - call mkdir(s:xdgcachehome.'/backup', 'p', 0700) +if exists('s:xdgstatehome') && s:xdgstatehome !=# '' + if !isdirectory(s:xdgstatehome.'/backup') + call mkdir(s:xdgstatehome.'/backup', 'p', 0700) endif execute 'set backupdir^='.option#Escape(option#item#Escape( - \ s:xdgcachehome.'/backup'.(patch#('8.1.251') ? '//' : '') + \ s:xdgstatehome.'/backup'.(patch#('8.1.251') ? '//' : '') \)) endif @@ -304,12 +302,12 @@ endif " its name, in order to avoid filename collisions, since the 'directory' " option has supported that hint for much longer than 'backupdir' has. " -if exists('s:xdgcachehome') && s:xdgcachehome !=# '' - if !isdirectory(s:xdgcachehome.'/swap') - call mkdir(s:xdgcachehome.'/swap', 'p', 0700) +if exists('s:xdgstatehome') && s:xdgstatehome !=# '' + if !isdirectory(s:xdgstatehome.'/swap') + call mkdir(s:xdgstatehome.'/swap', 'p', 0700) endif execute 'set directory^='.option#Escape(option#item#Escape( - \ s:xdgcachehome.'/swap//' + \ s:xdgstatehome.'/swap//' \)) endif |