diff --git a/autoload/neosnippet/variables.vim b/autoload/neosnippet/variables.vim index 50a76f8..f7cc1c3 100644 --- a/autoload/neosnippet/variables.vim +++ b/autoload/neosnippet/variables.vim @@ -76,7 +76,9 @@ endfunction"}}} function! neosnippet#variables#data_dir() "{{{ let g:neosnippet#data_directory = \ substitute(fnamemodify(get( - \ g:, 'neosnippet#data_directory', '~/.cache/neosnippet'), + \ g:, 'neosnippet#data_directory', + \ ($XDG_CACHE_DIR != '' ? + \ $XDG_CACHE_DIR . '/neosnippet' : expand('~/.cache/neosnippet'))), \ ':p'), '\\', '/', 'g') if !isdirectory(g:neosnippet#data_directory) call mkdir(g:neosnippet#data_directory, 'p') diff --git a/doc/neosnippet.txt b/doc/neosnippet.txt index 9b011ba..305bb47 100755 --- a/doc/neosnippet.txt +++ b/doc/neosnippet.txt @@ -234,8 +234,8 @@ g:neosnippet#data_directory *g:neosnippet#data_directory* Specifies directory for neosnippet cache. If the directory doesn't exist the directory will be automatically generated. - Default value is expand('~/.cache/neosnippet'); the absolute - path of it. + Default value is "$XDG_CACHE_DIR/neosnippet" or + expand("~/.cache/neosnippet"); the absolute path of it. ------------------------------------------------------------------------------ KEY MAPPINGS *neosnippet-key-mappings*