Created
January 18, 2013 17:18
-
-
Save microft/4566260 to your computer and use it in GitHub Desktop.
Vim function to forget undo history. Very usefull.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" A function to clear the undo history | |
function! <SID>ForgetUndo() | |
let old_undolevels = &undolevels | |
set undolevels=-1 | |
exe "normal a \<BS>\<Esc>" | |
let &undolevels = old_undolevels | |
unlet old_undolevels | |
endfunction | |
command -nargs=0 ClearUndo call <SID>ForgetUndo() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment