Reputation: 4050
Typing :w
fails with No Swap File
, but only intermittently.
The status line says No Swap File
, and the save does not happen. I have to run :w
again, one or more times, before it finally punches through the error and actually saves.
It's infuriating because it's very easy to miss it when the save fails. I'll hit :w
, it'll fail, I won't notice. I'll go to run my code and it'll still be the old version. I'll be confused about why I'm not seeing my code changes, and then I'll have to go back and :w
a few more times for it to actually save.
I have this in my .vimrc:
set nobackup
set noswapfile
When I do :echo &swapfile
in my editing buffers it shows 0
.
How do I fix this? :w
fails with No Swap File
, but only intermittently.
Upvotes: 1
Views: 1426
Reputation: 4050
This was all due to the MacBook Pro butterfly keyboard, which is just shit. It often fails to register keys, registers keys twice even before the repeat timeout, and is prone to type-o's for touch typists due to the lack of tactile feedback. These shitty input errors were causing this problem. In normal mode I have ss
bound to :
, so when I want to save a file I type ssw<CR>
. That would sometimes register as sssw<CR>
instead, which would run :sw
(which is Show Swap File Name
). Changing the repeat timeout in Vim or in the OS X control panel doesn't fix it. The butterfly keyboard is just garbage and actively fights against you when you're typing.
Upvotes: 1