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 "normal a \<BS>\<Esc>"
:let &l:undolevels = old_undolevels
:unlet old_undolevels
Note use of `&l:undolevels` to explicitly read the local value of 'undolevels'
and the use of `:setlocal` to change only the local option (which takes
precedence over the corresponding global option value). Saving the option value
via the use of `&undolevels` is unpredictable; it reads either the local value
(if one has been set) or the global value (otherwise). Also, if a local value
has been set, changing the option via `:set undolevels` will change both the
global and local values, requiring extra work to save and restore both values.
Marks for the buffer ('a to 'z) are also saved and restored, together with the
text.
When all changes have been undone, the buffer is not considered to be changed.
It is then possible to exit Vim with ":q" instead of ":q!".
Note that this is relative to the last write of the file. Typing "u" after
":w" actually changes the buffer, compared to what was written, so the buffer
is considered changed then.
When manual |folding| is being used, the folds are not saved and restored.
Only changes completely within a fold will keep the fold as it was, because
the first and last line of the fold don't change.
The numbered registers can also be used for undoing deletes. Each time you
delete text, it is put into register "1. The contents of register "1 are
shifted to "2, etc. The contents of register "9 are lost. You can now get
back the most recent deleted text with the put command: '"1P'. (also, if the
deleted text was the result of the last delete or copy operation, 'P' or 'p'
also works as this puts the contents of the unnamed register). You can get
back the text of three deletes ago with '"3P'.
*redo-register*
If you want to get back more than one part of deleted text, you can use a
special feature of the repeat command ".". It will increase the number of the
register used. So if you first do '"1P', the following "." will result in a
'"2P'. Repeating this will result in all numbered registers being inserted.
Example: If you deleted text with 'dd....' it can be restored with
'"1P....'.
If you don't know in which register the deleted text is, you can use the
:display command. An alternative is to try the first register with '"1P', and
if it is not what you want do 'u.'. This will remove the contents of the
first put, and repeat the put command for the second register. Repeat the
'u.' until you got what you want.
vim:tw=78:ts=8:noet:ft=help:norl: