4 ms·
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
by hyp0 12y ago
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?
- hf 12y agoAs 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.
- hyp0 12y agowhoa, 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-tree-used http://stackoverflow.com/questions/1088864/how-is-vims-undo-...
- certainly_not 12y agoundotree only becomes usable once you install https://github.com/sjl/gundo.vim https://github.com/sjl/gundo.vim It's a lifesaver after that.
- jordanlewis 12y agoIt's one of my favorite features! Full disclosure - I made it during my Google Summer of Code with Bram in 2008.
- diego898 12y agoit was the feature that kept me on vim for years until moving to sublime. I wish someone would implement it for sublime as well!