Vim: Stop "existing swap file" warnings

In .vimrc add:

set shortmess+=A

From the docs :help shortmess:

A don't give the "ATTENTION" message when an existing swap file is found.


There is plugin that can "Just do the right thing" automatically for Vim swapfiles: vim-autoswap.

From the homepage:

Dealing with swap files is annoying. Most of the time you have to deal with a swap file because you either have the same file open in another window or it is a swap file left there by a previous crash.

This plugin does for you what you would do in these cases:

  • Is file already open in another Vim session in some other window?
  • If so, swap to the window where we are editing that file.
  • Otherwise, if swapfile is older than file itself, just get rid of it.
  • Otherwise, open file read-only so we can have a look at it and may save it.

Command-Q on the Mac OS quits the Terminal window, and crashes every application running in the window.

To quit VIM, you have to use ordinary VIM commands like :q.