diff --git a/plugin/gnupg.vim b/plugin/gnupg.vim index 309f487..ac6cc41 100644 --- a/plugin/gnupg.vim +++ b/plugin/gnupg.vim @@ -114,6 +114,9 @@ augroup GnuPG " undo the encryption so we are back in the normal text, directly " after the file has been written. autocmd BufWritePost,FileWritePost *.\(gpg\|asc\|pgp\) call s:GPGEncryptPost() + + " cleanup on leaving vim + autocmd VimLeave *.\(gpg\|asc\|pgp\) call s:GPGCleanup() augroup END " Section: Highlight setup {{{1 @@ -220,6 +223,16 @@ function s:GPGInit() let s:GPGCompress = substitute(output, ".*Compress: \\(.\\{-}\\)\n.*", "\\1", "") endfunction +" Function: s:GPGCleanup() {{{2 +" +" cleanup on leaving vim +" +function s:GPGCleanup() + " wipe out screen + new +only + redraw! +endfunction + " Function: s:GPGDecrypt() {{{2 " " decrypt the buffer and find all recipients of the encrypted file