I got a strange behavior of vim 8.1 1-279 / archlinux 4.17.14

This is vim under console but I believe there's no different.

Vim force create ~/.cache/vim/{backup,swap,undo} folders even I set noundofile nobackup noswapfile in .vimrc

Is there something that I missed?

  • From :h 'backupdir': "The directory must exist, Vim will not create it for you." By chance do you have something set in your vimrc or a plugin creating these for you? The default for 'backupdir' is .,~/tmp,~/ so I think it is unlikely Vim would create a path of ~/.cache/vim Aug 28, 2018 at 14:26
  • Indeed, I start vim -u NONE and no ~/.cache/vim created. How to track what plugin causes it? @PeterRincker
    – Tuyen Pham
    Aug 29, 2018 at 1:15
  • @TuyenPham Since your problem comes from your .vimrc and your question becomes "How to track what plugin causes it?" I'm closing your question as a duplicate since it is exactly what this answer is about
    – statox
    Aug 29, 2018 at 8:30
  • 1
    In my opinion, the easiest would be to simply search for the string .cache/vim. e.g. rg -F '.cache/vim (uses ripgrep). You can also use :verbose and :set to find out more information about an option setting, e.g. :verbose set backupdir?. Some more generic debugging advice. Aug 29, 2018 at 15:26
  • From :verbose set backupdir?: backupdir=~/.vim/cache/backup,~/.vim/cache,/var/tmp/vim,/var/tmps Last set from ~/.vimrc. So last set is from ~/.vimrc, it doesn't find any from other sources.
    – Tuyen Pham
    Aug 30, 2018 at 2:28


Browse other questions tagged or ask your own question.