Thursday, January 2, 2014

Re: Recovering data after massive deletions

On 2 January 2014, Eric Smith <es@fruitcom.com> wrote:
> Due to a faulty keyboard, an `x' was sent repeatedly to the
> terminal with a file open in vim.
> The large file was reduced to a few lines as a result.
[...]

Not a direct answer to your question, but there's a trick you can
use to avoid this kind of problems in the future:

set undodir=~/.vim/undo
set undofile

See ":help undo-persistence" for more details.

You might also run something like this from a daily cron job, to
keep old undo files from piling up:

find "$HOME"/.vim/undo -type f -name '%home%*' -mtime +30 -print0 | \
xargs -0 rm -f

/lcd

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: