read or written.
NOTE: undo files are never deleted by Vim. You need to delete them yourself.
Reading an existing undo file may fail for several reasons:
*E822* It cannot be opened, because the file permissions don't allow it.
*E823* The magic number at the start of the file doesn't match. This usually
means it is not an undo file.
*E824* The version number of the undo file indicates that it's written by a
newer version of Vim. You need that newer version to open it. Don't
write the buffer if you want to keep the undo info in the file.
"File contents changed, cannot use undo info"
The file text differs from when the undo file was written. This means
the undo file cannot be used, it would corrupt the text. This also
happens when 'encoding' differs from when the undo file was written.
*E825* The undo file does not contain valid contents and cannot be used.
"Not reading undo file, owner differs"
The undo file is owned by someone else than the owner of the text
file. For safety the undo file is not used.
Writing an undo file may fail for these reasons:
*E828* The file to be written cannot be created. Perhaps you do not have
write permissions in the directory.
"Cannot write undo file in any directory in 'undodir'"
None of the directories in 'undodir' can be used.
"Will not overwrite with undo file, cannot read"
A file exists with the name of the undo file to be written, but it
cannot be read. You may want to delete this file or rename it.
"Will not overwrite, this is not an undo file"
A file exists with the name of the undo file to be written, but it
does not start with the right magic number. You may want to delete
this file or rename it.
"Skipping undo file write, nothing to undo"
There is no undo information to be written, nothing has been changed
or 'undolevels' is negative.
*E829* An error occurred while writing the undo file. You may want to try
again.
==============================================================================
6. Remarks about undo *undo-remarks*
The number of changes that are remembered is set with the 'undolevels' option.
If it is zero, the Vi-compatible way is always used. If it is negative no
undo is possible. Use this if you are running out of memory.
*clear-undo*
When you set 'undolevels' to -1 the undo information is not immediately
cleared, this happens at the next change. To force clearing the undo
information you can use these commands: >
:let old_undolevels = &l:undolevels
:setlocal undolevels=-1
:exe