Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Mastering Vim

You're reading from  Mastering Vim

Product type Book
Published in Nov 2018
Publisher Packt
ISBN-13 9781789341096
Pages 330 pages
Edition 1st Edition
Languages
Author (1):
Ruslan Osipov Ruslan Osipov
Profile icon Ruslan Osipov

Table of Contents (12) Chapters

Preface 1. Getting Started 2. Advanced Editing and Navigation 3. Follow the Leader - Plugin Management 4. Understanding the Text 5. Build, Test, and Execute 6. Refactoring Code with Regex and Macros 7. Making Vim Your Own 8. Transcending the Mundane with Vimscript 9. Neovim 10. Where to Go from Here 11. Other Books You May Enjoy

Undo tree and Gundo

Most modern editors support an undo stack, with undoing and replaying operations. Vim takes that one step further by introducing an undo tree. If you make a change, X, undo it, and then make a change, Y—Vim still saves the change, X. Vim supports manually browsing undo tree leaves, but there's a better way to do this.

Gundo is a plugin that visualizes the undo tree and is available from GitHub at: https://github.com/sjl/gundo.vim.git.

If you're using vim-plug to manage your plugins, add the following to your .vimrc file: Plug 'sjl/gundo.vim'. Execute :w | so $MYVIMRC | PlugInstall and you'll have Gundo installed and ready to go.

Let's say you're working on animal_farm.py, with your cursor on line 15:

You're editing the highlighted line: if kind == 'cat'. You perform the following operations:

  1. Replace...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}