What is the correct way to make git ignore temporary files produced by vim in all directories (either globally across the system or locally for a single project)?
This works on a Mac as noted by Alex Moore-Niemi:
set backupdir=$TMPDIR// set directory=$TMPDIR//
Make sure to use TMPDIR and not TEMPDIR.
TMPDIR
TEMPDIR