Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

persistent undo seems pretty cool!

enable with :set undofile in .vimrc

NB: if you want to specify a dir for it, you need to create it yourself, or it silently won't work. eg mkdir ~/.vim/undodir, then in .vimrc :set undodir=~/.vim/undodir

I also love the idea of undotree, with branches etc, but found it too confusing in practice. Could the UI be more git-like, I wonder?



As with many of Vim's questionable but ultimately effective interface decisions, I have found 'chronological undo' to alleviate all my undo-tree-related pains: Step through the undo tree sequentially with 'g+' and 'g-' until you've found what you're looking for.


whoa, just tried it, works and makes sense! It just undoes everything, including undos; but not g-/g+ themselves (which are purely browsing). Nice SO ans: http://stackoverflow.com/questions/1088864/how-is-vims-undo-...


It's one of my favorite features!

Full disclosure - I made it during my Google Summer of Code with Bram in 2008.


undotree only becomes usable once you install https://github.com/sjl/gundo.vim

It's a lifesaver after that.


Completely agree with this. I actually think vims undo tree might be the most useful feature in vim for me. You can basically use it as version control lite with automatic commits.


You took the words right out of my mouth. Gundo is great.


it was the feature that kept me on vim for years until moving to sublime. I wish someone would implement it for sublime as well!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: