I've narrowed down a bug in a program I'm working on to (surprisingly) some vim behavior!
The program contains a file watcher.
When I write a file with vim -u NONE
and all the default settings, the behavior is as expected: some swap files are created and deleted, and the main file is saved.
But when I add :set nocompatible
, I get the following additional inotify events:
wd=149, mask=IN_CREATE (0x100), cookie=0, length=16, name='4913'
wd=149, mask=IN_ATTRIB (0x4), cookie=0, length=16, name='4913'
wd=149, mask=IN_DELETE (0x200), cookie=0, length=16, name='4913'
<normal events appear after>
This indicates that vim is creating, modifying, and then deleting a file called 4913
in the directory of the file I'm editing.
If I create such a file myself (and chmod 000
it), vim will use 5036
instead.
This leads me to believe that vim is looking for some arbitrary temporary file.
The number is always 4913
(across files, across reboots).
This is quite alarming.
I obviously want to use nocompatible
, but this is a prohibitive bug.
What can I do?
4913
and friends. The bug is that the file is called4913
instead of.vim_permissions_test
. I'm certain that I'm not the first person confused by such a filename. Just because it's not forbidden doesn't mean it's not unwise.