Wikia

Vim Tips Wiki

Changes: Undo and Redo

Edit

Back to page

(Comments)
(Replaced content with "Rust homepage: playrust.com Rust beta page: rustbeta.com")
Line 1: Line 1:
{{TipImported
+
Rust homepage: playrust.com
|id=39
+
Rust beta page: rustbeta.com
|previous=38
 
|next=40
 
|created=2001
 
|complexity=basic
 
|author=
 
|version=6.0
 
|rating=631/256
 
|category1=Getting started
 
|category2=Undo
 
}}
 
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'''.
 
 
==References==
 
*{{help|undo}}
 
 
==Comments==
 
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: playrust.com Rust beta page: rustbeta.com

Around Wikia's network

Random Wiki