Vim Tips Wiki
No edit summary
(Undo revision 28793 by 205.228.82.171 (talk); don't be an ass)
Line 14: Line 14:
 
*<tt>u</tt>: undo last change (can be repeated to undo preceding commands)
 
*<tt>u</tt>: undo last change (can be repeated to undo preceding commands)
 
*<tt>U</tt>: return the line to its original state (undo all changes in current line)
 
*<tt>U</tt>: return the line to its original state (undo all changes in current line)
*<tt>Ctrl-r</tt>: Redo changes which were undone (undo the undos). Compare to '<tt>.</tt>' to ''repeat'' a previous change, at the current cursor position. Ctrl-r will redo a previously undone change, wherever the change occurred.
+
*<tt>Ctrl-R</tt>: Redo changes which were undone (undo the undos). Compare to '<tt>.</tt>' to ''repeat'' a previous change, at the current cursor position. Ctrl-R will redo a previously undone change, wherever the change occurred.
   
 
Note that (somewhat confusingly) <tt>U</tt> is undo-able with <tt>u</tt>.
 
Note that (somewhat confusingly) <tt>U</tt> is undo-able with <tt>u</tt>.
Line 24: Line 24:
 
==References==
 
==References==
 
*{{help|undo}}
 
*{{help|undo}}
  +
  +
==Comments==
  +
<tt>Ctrl-R</tt> means to hold down the <tt>Ctrl</tt> key then press the <tt>R</tt> key. Note that you do not press the <tt>Shift</tt> key. Vim documentation uses traditional computer terminology including CTRL-R. In keeping with a more modern approach, we generally use "Ctrl" rather than "CTRL" on this wiki. The tips are not entirely consistent regarding whether to write Ctrl-R or Ctrl-r, but mostly Ctrl-R is preferred. [[User:JohnBeckett|JohnBeckett]] 10:04, March 18, 2010 (UTC)

Revision as of 14:24, 17 November 2010

Tip 39 Printable Monobook Previous Next

created 2001 · complexity basic · version 6.0


To undo recent changes, use the undo command:

  • u: undo last change (can be repeated to undo preceding commands)
  • U: return the line to its original state (undo all changes in current line)
  • Ctrl-R: Redo changes which were undone (undo the undos). Compare to '.' to repeat a previous change, at the current cursor position. Ctrl-R will redo a previously undone change, wherever the change occurred.

Note that (somewhat confusingly) U is undo-able with u.

See also

References

Comments

Ctrl-R means to hold down the Ctrl key then press the R key. Note that you do not press the Shift key. Vim documentation uses traditional computer terminology including CTRL-R. In keeping with a more modern approach, we generally use "Ctrl" rather than "CTRL" on this wiki. The tips are not entirely consistent regarding whether to write Ctrl-R or Ctrl-r, but mostly Ctrl-R is preferred. JohnBeckett 10:04, March 18, 2010 (UTC)