Yakov

I've tried similar way before. It works, but the window flashes when I'm saving
(because the buffer switches between dummy and "this")
which is not very decent.

:w<CR>:e<CR>
works simple and great !

Thanks
Eddy

2006/4/30, Yakov Lerner <[EMAIL PROTECTED]>:
On 4/30/06, Eddy Zhao <[EMAIL PROTECTED]> wrote:
> At some point, I want to permanently save the buffer with out the
> possibility of
> accidentally undo the changes I've made (this happens sometimes). How
> can I clear
> the undo stack (without leaving the current buffer). Or any other simpler way 
of
> achieving this?

I believe this sequence clears undo stack:
    :up! | set nohidden | e dummy | bw
It might be useful add save/restore of 'hidden' option:
    :up! | let x=&hidden | set nohid | e dummy |bw | let &hidden=x
If you want to map it , remember to change | to <bar>
   map <f9> :up! <bar> ...etc

Yakov

Reply via email to