I'm familiar with this message when a command's output is more than one line.

However, on one of the systems I use, I see it every time I write with :w, despite having plenty of horizontal space for the message. For example:

enter image description here

This only seems to happen when I use vim in a tmux session, but I can't work out why this should happen. Every other aspect of vim and tmux seems to be working fine. Turns out it has nothing to do with tmux.

Update: I tracked it down to the following line in my vimrc:

set backupdir=/tmp

Using a vimrc that contains only this line is enough to trigger the message when writing to a file. Interestingly, it only happens when I write to an existing file.

Why would this happen, and on this machine only?

  • Do any of these tips help? vim.wikia.com/wiki/… – Jeff Schaller Dec 21 '15 at 18:54
  • I've looked at those, but they seem to be concerned with suppressing the message, while it seems to be that it shouldn't be there in the first place. – Will Vousden Dec 21 '15 at 19:49

Without looking at the exact environment, I can only guess that /tmp does not exist (or is full or has some permission issue) on the culprit machine. When-ever you write to existing file, vim is not able to save the backup, so it is complaining, and then prompting you.

You can check if this is the case by trying one of the following:

  1. See if you can save the file without the prompt using :w!.
  2. See if you can get some error message before the prompt by adding this to .vimrc:

    set cmdheight=N

    Try N=2 or 3 or 4, whichever works fine for your environment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.