0
  .   �_’I|¥‰ÓMjqØ‚¦ð¬÷a–Ðz¾””ÔD¨ 	ÅíÀ?p!S�ÿÀ      File not found.
     �¿¾À      File not found.
  ,   ˆl–äY>”êe¶…8 …p\Å£Ã„�¼×_‡I|¥ŠèªÀÂ ?÷     *undo.txt*      For Vim version 8.2.  Last change: 2020 Nov 30


		  VIM REFERENCE MANUAL    by Bram Moolenaar


Undo and redo						*undo-redo*

The basics are explained in section |02.5| of the user manual.

1. Undo and redo commands	|undo-commands|
2. Two ways of undo		|undo-two-ways|
3. Undo blocks			|undo-blocks|
4. Undo branches		|undo-branches|
5. Undo persistence		|undo-persistence|
6. Remarks about undo		|undo-remarks|

==============================================================================
1. Undo and redo commands				*undo-commands*

<Undo>		or					*undo* *<Undo>* *u*
u			Undo [count] changes.

							*:u* *:un* *:undo*
:u[ndo]			Undo one change.
								*E830*
:u[ndo] {N}		Jump to after change number {N}.  See |undo-branches|
			for the meaning of {N}.

							*CTRL-R*
CTRL-R			Redo [count] changes which were undone.

							*:red* *:redo* *redo*
:red[o]			Redo one change which was undone.

							*U*
U			Undo all latest changes on one line, the line where
			the latest change was made. |U| itself also counts as
			a change, and thus |U| undoes a previous |U|.

The last changes are remembered.  You can use the undo and redo commands above
to revert the text to how it was before each change.  You can also apply the
changes again, getting back the text before the undo.

The "U" command is treated by undo/redo just like any other command.  Thus a
"u" command undoes a "U" command and a 'CTRL-R' command redoes it again.  When
mixing "U", "u" and 'CTRL-R' you will notice that the "U" command will
restore the situation of a line to before the previous "U" command.  This may
be confusing.  Try it out to get used to it.
The "U" command will always mark the buffer as changed.  When "U" changes the
buffer back to how it was without changes, it is still considered changed.
Use "u" to undo changes until the buffer becomes unchanged.

==============================================================================
2. Two ways of undo					*undo-two-ways*

How undo and redo commands work depends on the 'u' flag in 'cpoptions'.
There is the Vim way ('u' excluded) and the Vi-compatible way ('u' included).
In the Vim way, "uu" undoes two changes.  In the Vi-compatible way, "uu" does
nothing (undoes an undo).

'u' excluded, the Vim way:
You can go back in time with the undo command.  You can then go forward again
with the redo command.  If you make a new change after the undo command,
the redo will not be possible anymore.

'u' included, the Vi-compatible way:
The undo command undoes the previous change, and also the previous undo
command.  The redo command repeats the previous undo command.  It does NOT
repeat a change command, use "." for that.

Examples	Vim way			Vi-compatible way	~
"uu"		two times undo		no-op
"u CTRL-R"	no-op			two times undo

Rationale:  Nvi uses the "." command instead of CTRL-R.  Unfortunately, this
	    is not Vi compatible.  For example "dwdwu." in Vi deletes two
	    words, in Nvi it does nothing.

==============================================================================
3. Undo blocks						*undo-blocks*

One undo command normally undoes a typed command, no matter how many changes
that command makes.  This sequence of undo-able changes forms an undo block.
Thus if the typed key(s) call a function, all the commands in the function are
undone together.

If you want to write a function or script that doesn't create a new undoable
change but joins in with the previous change use this command:

						*:undoj* *:undojoin* *E790*
:undoj[oin]		Join further changes with the previous undo block.
			Warning: Use with care, it may prevent the user from
			properly undoing changes.  Don't use this after undo
			or redo.

This is most useful when you need to prompt the user halfway through a change.
For example in a function that calls |getchar()|.  Do make sure that there was
a related change before this that you must join with