Is there an option to control .cache folder location in Vim? Is there a setting or a variable for this?
This is one of the differences between Vim and Neovim. The latter supports XDG, the former doesn't. That being said, you can make Vim to respect XDG by manually setting some locations, but you have to decide what kind of stuff you want to put on
$XDG_CONFIG_CACHE. For example you could put your
set viminfo+=n$XDG_CACHE_HOME/vim/viminfo. Also backups and swap files:
set directory=$XDG_CACHE_HOME/vim set backupdir=$XDG_CACHE_HOME/vim
(Neovim consider these data, so they go in
As a side note, to have all your configuration on
$XDG_CONFIG_HOME you can use
set runtimepath=$XDG_CONFIG_HOME/vim,$XDG_CONFIG_HOME/vim/after,$VIM,$VIMRUNTIME let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc"