Vim Tips Wiki

Changes: Undo and Redo


Back to page

(Replaced content with "Rust homepage: Rust beta page:")
Line 1: Line 1:
Rust homepage:
Rust beta page:
|category1=Getting started
To undo recent changes, use the undo command:
*<code>u</code>: undo last change (can be repeated to undo preceding commands)
*<code>Ctrl-R</code>: Redo changes which were undone (undo the undos). Compare to '<code>.</code>' to ''repeat'' a previous change, at the current cursor position. Ctrl-R will redo a previously undone change, wherever the change occurred.
A related command is:
*<code>U</code>: return the last line which was modified to its original state (reverse all changes in last modified line)
<code>U</code> is not actually a true "undo" command as it does not actually navigate undo history like <code>u</code> and <code>CTRL-R</code>. This means that (somewhat confusingly) <code>U</code> is itself undo-able with <code>u</code>; it creates a ''new'' change to reverse previous changes.
<code>U</code> is seldom useful in practice, but is often accidentally pressed instead of <code>u</code>, so it is good to know about.
==See also==
*[[Recover from accidental Ctrl-U]], which explains what constitutes a '''change''' which can be undone.
*[[Using undo branches]], which explains Vim's unique and very powerful '''undo tree'''.
nnoremap U <ESC>:echo " < < ===== C H E C K C A P S L O C K ===== > > "<CR>

Revision as of 05:04, July 12, 2013

Rust homepage: Rust beta page:

Around Wikia's network

Random Wiki