1

I'm trying to get rid of

Error detected while processing FocusLost Auto commands for "*":
E141: No file name for buffer 1 

I checked out: Vim: Saving on FocusLost and executing auto command

and: How can I make Vim autosave files when it loses focus?

but adding autocmd FocusLost * nested silent! wall to the end of my .vimrc didn't help

Any ideas?

I'm using MacVim

Community
  • 1
  • 1
Alisso
  • 1,861
  • 1
  • 17
  • 32

1 Answers1

0

Is this just because you haven't provided a filename yet?

It might not happen if you run

:w myfilename 

straight away. When I tested the above line in my .vimrc (on Debian) it worked just fine with gVim. But only after I'd provided a filename.

I don't get the error you're getting when I don't provide a filename though.

Medlock Perlman
  • 147
  • 1
  • 10
  • 2
    I see this as a workaround, I wish it was able to just let it be as it is when there is no filename, so only autosaving items that do have a filename. – Alisso Jun 18 '18 at 09:23