" use XDG if empty($MYVIMRC) | let $MYVIMRC = expand('%:p') | endif if empty($XDG_CACHE_HOME) | let $XDG_CACHE_HOME = $HOME.'/.cache' | endif if empty($XDG_CONFIG_HOME) | let $XDG_CONFIG_HOME = $HOME.'/.config' | endif if empty($XDG_DATA_HOME) | let $XDG_DATA_HOME = $HOME.'/.local/share' | endif if empty($XDG_STATE_HOME) | let $XDG_STATE_HOME = $HOME.'/.local/state' | endif set runtimepath^=$XDG_CONFIG_HOME/vim set runtimepath+=$XDG_CONFIG_HOME/vim/after set runtimepath+=$XDG_DATA_HOME/vim set packpath^=$XDG_DATA_HOME/vim if !isdirectory($XDG_DATA_HOME.'/vim/spell') call mkdir($XDG_DATA_HOME.'/vim/spell', 'p', 0700) endif set backupdir=$XDG_CACHE_HOME/vim/backup/ set directory=$XDG_CACHE_HOME/vim/swap/ set undodir=$XDG_CACHE_HOME/vim/undo/ set viewdir=$XDG_CACHE_HOME/vim/view/ if !isdirectory(&backupdir) call mkdir(&backupdir, 'p', 0700) endif if !isdirectory(&directory) call mkdir(&directory, 'p', 0700) endif if !isdirectory(&undodir) call mkdir(&undodir, 'p', 0700) endif if !isdirectory(&viewdir) call mkdir(&viewdir, 'p', 0700) endif if !has('nvim') set viminfofile=$XDG_CACHE_HOME/vim/viminfo endif