Comment

Comment by Lio

It's not mentioned in the article but Vim (and NeoVim) keep undo/redo history in a tree rather than a simple linear timeline[1].

The practical usage is it's aways possible to get back to a previous state you were in, which is pretty neat.

e.g. You can undo 5 changes, try something else and decide that you prefered the text before you started undoing things. In most programs with a linear undo history you've wiped out your previous changes but not in Vim.

You can hop about the branches of the undo tree using the g+ and g- commands but it's much easier to add an undo tree visualiser plugin such as the venerable old Gundo[2].

1. https://neovim.io/doc/user/undo.html

2. https://docs.stevelosh.com/gundo.vim/

parent Lio 8 months ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton