3 ms·
Another great Vim feature is persistent undo. You open a file, make modifications, save and close. You open again and the undo history is still there. You'll ju
by kzrdude 4y ago
Another great Vim feature is persistent undo. You open a file, make modifications, save and close. You open again and the undo history is still there. You'll just have to enable that feature.. don't think it's on by default, unfortunately. Find a ~/.cache directory to store the undo history in.
- samtheprogram 4y agoThis would make my life so much easier — constantly accidentally closing a file when I want to hold on to the undo history to redo something. Do you know the name of the feature/flag/setting?
- pjungwir 4y agoThis is what I have in my ~/.vimrc: " https://vi.stackexchange.com/questions/6/how-can-i-use-the-undofile if !isdirectory($HOME."/.vim") call mkdir($HOME."/.vim", "", 0770) endif if !isdirectory($HOME."/.vim/undo-dir") call mkdir($HOME."/.vim/undo-dir", "", 0700) endif set undodir=~/.vim/undo-dir set undofile
- kzrdude 4y agoThat's neat, and a missing part of my vimrc - making sure the directories I use exist. Since I use .cache and exclude those from backups, it's actually bit me. I've added this thanks to you: call mkdir($HOME . "/.cache/vim/", "p", 0o700) I think this avoids using the conditionals, by just using "p".