If I edit a directory (say 'foo') in Vim, then Vim always creates an empty directory named 'foo/~'. In my vimrc, I specify 'nobackup', 'nowritebackup', and 'backupdir=$TEMP/vim//'. With the backupdir setting, when I do enable backup files they go to the temp directory as expected.
Still, on both OS X and on Windows, Vim creates empty '~' directories, which are, of course, like leaving very dangerous mines littered around my machine (at least on OS X, where 'rm -rf ~' would be the start of a Bad Day).
I haven't been able to find any information about the empty '~' directory specifically, but lots on backups in general.
How can I disable the creation of empty '~' directories?
Figured it out. In my vimrc file, I had the following setting:
let netrw_home = "~"
I believe I originally did that to keep netrw from cluttering my home directory with ".netrwhist" and ".netrwbook". The problem is that the tilde wasn't expanded to my home directory, and instead netrw created a literal directory named "~" in the current directory to store those state files.
The fix I used was to leave the netrw_home variable undefined, and let it use the default value of the first directory on the 'runtimepath' path list. I had to add my home directory ($HOME) as the first directory on my runtime path, but so far that seems to work fine.
For whatever reason, I couldn't get ~ or $HOME to work for netrw_home on Windows, but that's probably my misunderstanding of some Vim details. I don't have time to investigate further, and I'm past this issue now, so that's where I'll stop.
Thanks to Wayne Werner above for doing a quick experiment to see if he had the same behavior. That's what kicked me in the right direction.