57203Re: [vim73] easy way to purge 'persistence undo'?
- Jun 3, 2010SungHyun Nam wrote:
> Dominique Pellé wrote:No, it did NOT work. :-(
>> Christian Brabandt wrote:
>>> On Do, 03 Jun 2010, SungHyun Nam wrote:
>>>> With vim-7.3 (+ 'undofile'):
>>>> I guess I could remove a undofile and run ':e' to do this. Maybe
>>>> I can make a mapping with some vim script, but...
>>>> Is there any easy way to purge 'persistence undo' history?
> And I made a function, it works for me.
> func! util#purgeUndoHistory()
> let file = undofile(expand('%:p'))
> if filereadable(file)
> let oldundofile = &l:undofile
> setl noundofile
> silent! exec "!rm -f ".file
> let &l:undofile = oldundofile
Edit and save a 'file.c', and...
$ vim file.c
And if I type 'u', vim displays:
Already at oldest change
But, when I exit VIM and open the file.c again, 'u' works again.
And I found the undofile was not removed. The exec line should be
silent! exec "!rm -f ".escape(file, '%')
You received this message from the "vim_dev" 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
- << Previous post in topic Next post in topic >>