Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Take A QuizChallenge yourself and boost your learning! Start the quiz now to earn credits.
Take A QuizUnlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
Take A Quiz 
                Please log in to access this content. You will be redirected to the login page shortly.
LoginGeneral Tech Learning Aids/Tools 3 years ago
Posted on 16 Aug 2022, this text provides information on Learning Aids/Tools related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
No matter what stage you're at in your education or career, TuteeHUB will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
 
                Please log in to access this content. You will be redirected to the login page shortly.
Login 
                        Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.
 
                        Your experience on this site will be improved by allowing cookies. Read Cookie Policy
Your experience on this site will be improved by allowing cookies. Read Cookie Policy
manpreet![Tuteehub forum best answer]() Best Answer
                                                
                                                                                                        3 years ago
                                                    Best Answer
                                                
                                                                                                        3 years ago
                                                
                                            
I'm trying to understand how to move in the undo tree with the following default mappings:
u,g-andg+Here's my understanding of things, which is probably wrong or incomplete. Each time we make a new edit, a new leaf is created in the undo tree. The more we make edits, the more leafs are added along a branch.
To move along the branch, we can use
uto go back to the original version of the buffer, andThis can be confirmed with the simple following test:
1,2, again to3and again to4Using
uand1,2,3and4.If at one point, we go backward and make a new edit from a past leaf, we create a new branch. The leafs which are not between the root of the tree (the original buffer) and the beginning of the new branch (the last edit we just made) can't be accessed with
uandGoing back to the example, this can be confirmed:
4, hituto go back to3r5to replace3with5uto undo the last editThe last
udoesn't bring us back to4but to3.We can't go back anymore to
4withuand4is not on the shortest path between the original empty buffer and5, because5was created from3.To go back to any leaf of the undo tree, we can use
g-andg+. Contrary touandTo confirm this:
uup to the original empty bufferg+5 times to reach1,2,3,4and5g-5 times to get back to4,3,2,1and the empty bufferHowever, there's one case I don't understand. If from
5, we hituto get back to3, theng+, we get5. But on the time axis, the nearest leaf from3is not5, it's4.So why does Vim bring us to
5instead of4?