How can I permanently save the last code until next restart in vim -


so question if writing code in vim & want go 20 minutes earlier, type :earlier 20m in vim. doesn't work if exit vim once or reboot system. understand stored temporary registers , once vim restarts, cleans whole register buffers. there way can save last changes & apply undo mechanisms. work on big project files & if wrong occurs, can not go back.

in vim 7.3 or later, can use undo file.

put in .vimrc.

set undofile 

by default save 100 actions undo. if want more, can set manually adding .vimrc, whatever number want:

set undolevels=100 

persistent undo create undo files in same directories files work on. if want put these in separate directory don't clutter filesystem, add .vimrc:

set undodir=~/.vim/undo 

then, need make directory. command line:

mkdir ~/.vim/undo 

i using version control instead of relying on vim's persistent undo track changes in projects.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -