About: Using undo branches   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : 134.155.108.49:8890 associated with source dataset(s)

Vim 7.0 and later support undo branches. This feature prevents the loss of changes, even if you switch back to an earlier state of your text and start editing there. A change in this context is considered as all editing you have made while in insert mode, or a single editing command in normal or command-line mode. As soon as you leave insert mode a new change will start. It is important to leave insert mode so you will really create a new distinct change to which you can later move back, otherwise all changes that are done while you are in insert mode will be considered the same change. While in insert mode, you can also press Ctrl-G then u to break the undo sequence and start a new change. In fact, it is probably a good idea to automatically do this in some situations, for example so you

AttributesValues
rdfs:label
  • Using undo branches
rdfs:comment
  • Vim 7.0 and later support undo branches. This feature prevents the loss of changes, even if you switch back to an earlier state of your text and start editing there. A change in this context is considered as all editing you have made while in insert mode, or a single editing command in normal or command-line mode. As soon as you leave insert mode a new change will start. It is important to leave insert mode so you will really create a new distinct change to which you can later move back, otherwise all changes that are done while you are in insert mode will be considered the same change. While in insert mode, you can also press Ctrl-G then u to break the undo sequence and start a new change. In fact, it is probably a good idea to automatically do this in some situations, for example so you
Version
  • 7(xsd:integer)
dbkwik:vim/property/wikiPageUsesTemplate
Previous
  • 1642(xsd:integer)
Category
  • Undo
Text
  • undotree
  • Gundo plugin
  • Undo Branches Explorer
  • histwin
Author
  • Chrisbra
Subpage
  • /201005
Complexity
  • basic
Created
  • 2010-05-11(xsd:date)
ID
  • 1643(xsd:integer)
  • 2141(xsd:integer)
  • 2932(xsd:integer)
  • 3304(xsd:integer)
  • 4177(xsd:integer)
NEXT
  • 1644(xsd:integer)
abstract
  • Vim 7.0 and later support undo branches. This feature prevents the loss of changes, even if you switch back to an earlier state of your text and start editing there. A change in this context is considered as all editing you have made while in insert mode, or a single editing command in normal or command-line mode. As soon as you leave insert mode a new change will start. It is important to leave insert mode so you will really create a new distinct change to which you can later move back, otherwise all changes that are done while you are in insert mode will be considered the same change. While in insert mode, you can also press Ctrl-G then u to break the undo sequence and start a new change. In fact, it is probably a good idea to automatically do this in some situations, for example so you can undo one inserted line at a time, so you can recover if you change your mind after pressing Ctrl-U in normal mode, or so you can execute a normal-mode command you accidentally entered in insert mode. Note, that some commands (CTRL-G u is one of these) will break your insert mode edits into multiple changes. See [help ins-special-special] for details. You can imagine the undo branches like a tree with the top node being the first change that you have made to your text. Whenever you undo some changes and make a new change you create a new node. Using u in normal mode will undo your last change and move you through the tree upwards. In contrast redo (Ctrl-R) will move down through this tree of changes. This is the same, as was done before Version 7 was released and is backwards compatible with other vi clones. But you can also move through the changes in the order they were made. Thus g- will move you to the previous change, regardless where it is situated in your undo tree. Further use of g- will move you to the chronological previous change. As g- moves backwards through the undo tree, g+ will move forward through all changes until the final state is reached. Besides the use of g+ and g- you can also use the ex-commands :earlier and :later. Both commands optionally accept either a count or a an amount of time that you want to move, thus :earlier 10 will move 10 changes backwards through the undo tree, and :earlier 1h will move to the state of the buffer as it existed 1 hour ago (use s for seconds, m for minutes, and h for hours), and then :later 10 or :later 1h will restore the buffer to the latest state after moving backwards to a previous state. With the addition of persistent undo in Vim 7.3, the ex-commands above also provide the ability to easily revisit the state of the buffer exactly as it was the last time it was saved to a file (or 2 saves ago, 3 saves ago, etc.) using, for example, :earlier 1f.
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software