Created
August 22, 2009 02:03
-
-
Save soh335/172587 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
"{{{save start state | |
au BufRead * call <SID>SaveStart() | |
function! s:SaveStart() | |
let tmp = @@ | |
silent normal ggyG | |
let b:start_object = @@ | |
let @@ = tmp | |
endfunction | |
function! s:UndoStart() | |
if !exists("b:start_object") | |
return | |
end | |
let t = getpos('.') | |
let tmp = @@ | |
silent normal ggdG | |
call append(0, split(b:start_object, '\n')) | |
silent normal Gdd | |
let @@ = tmp | |
call setpos('.', t) | |
endfunction | |
command! UndoStart :call <SID>UndoStart() | |
"}}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment