:nos[wapfile] {command} *:nos* *:noswapfile*
Execute {command}. If it contains a command that loads a new
buffer, it will be loaded without creating a swapfile and the
'swapfile' option will be reset. If a buffer already had a
swapfile it is not removed and 'swapfile' is not reset.
Detecting an existing swap file ~
You can find this in the user manual, section |11.3|.
*W325*
The default |SwapExists| handler (|default-autocmds|) skips the |E325| prompt
(and automatically chooses "(E)dit") if the swapfile owner process is still
running and owned by the current user. This presumes that you normally don't
want to be bothered with the |ATTENTION| message just because you happen to
edit the same file from multiple Nvim instances. In the worst case (a system
crash) there will be more than one swapfile for the file; use |:recover| to
inspect all of its swapfiles.
Updating the swapfile ~
The swap file is updated after typing 200 characters or when you have not
typed anything for four seconds. This only happens if the buffer was
changed, not when you only moved around. The reason why it is not kept up to
date all the time is that this would slow down normal work too much. You can
change the 200 character count with the 'updatecount' option. You can set
the time with the 'updatetime' option. The time is given in milliseconds.
After writing to the swap file Vim syncs the file to disk.
If the writing to the swap file is not wanted, it can be switched off by
setting the 'updatecount' option to 0. The same is done when starting Vim
with the "-n" option. Writing can be switched back on by setting the
'updatecount' option to non-zero. Swap files will be created for all buffers
when doing this. But when setting 'updatecount' to zero, the existing swap
files will not be removed, it will only affect files that will be opened
after this.
If you want to make sure that your changes are in the swap file use this
command:
*:pre* *:preserve* *E313* *E314*
:pre[serve] Write all text for the current buffer into its swap
file. The original file is no longer needed for
recovery.
A Vim swap file can be recognized by the first six characters: "b0VIM ".
After that comes the version number, e.g., "3.0".
Links and symbolic links ~
On Unix it is possible to have two names for the same file. This can be done
with hard links and with symbolic links (symlinks).
For hard links Vim does not know the other name of the file. Therefore, the
name of the swapfile will be based on the name you used to edit the file.
There is no check for