According to the developer, syntastic does not create temporary directories by itself, that is handled by vim. Looking a bit further, I found that vim
uses $TMPDIR
to set a temporary directory. If the directory is unwritable, then it gets ignored.
So, as a solution, the following lines set the temporary directory to /tmp/vim-USERNAME
, and then create it (ignoring errors that normally occur when the directory exists):
" Keep all vim-related temp files in a single directory
let $TMPDIR = '/tmp/vim-' . $USER
silent! call mkdir($TMPDIR, '', 0700)
Now, I do not have a lot of /tmp/vXXXXXX/
directories anymore. Instead, they appear in /tmp/vim-peter/vXXXXXX/
which is great.