X-Git-Url: https://git.ao2.it/vim/signature_block.vim.git/blobdiff_plain/b7fd78cba105d437fc2b6230c2e7a4f110e2d163..a4448ab5be963936f528cdca251c51bfec0fe2a8:/plugin/signature_block.vim diff --git a/plugin/signature_block.vim b/plugin/signature_block.vim index d7eb8e0..8d19134 100644 --- a/plugin/signature_block.vim +++ b/plugin/signature_block.vim @@ -15,10 +15,10 @@ " map R :call ReplaceAllSignatures('~/.signature') " " " Append a signature block to all e-mails -" autocmd FileType mail silent call AddSignature('~/.signature') | w +" autocmd FileType mail if AddSignature('~/.signature') | w | endif " -" " Append a signature block to cover letters generated with git-format-patch -" autocmd BufRead 0000-cover-letter.patch silent call AddSignature('~/.signature') | w +" " Replace the git version with a signature in cover letters generated with git-format-patch +" autocmd BufRead 0000-cover-letter.patch if ReplaceLastSignature('~/.signature') | w | endif " autocmd BufRead 0000-cover-letter.patch autocmd! BufRead 0000-cover-letter.patch " " References: @@ -105,7 +105,7 @@ func! ReplaceAllSignatures(sigfile) endtry call AppendSignature(a:sigfile) - + " restore cursor position from mark 'z' if the mark is still valid silent! normal `z @@ -133,7 +133,7 @@ func! ReplaceLastSignature(sigfile) endtry call AppendSignature(a:sigfile) - + " restore cursor position from mark 'z' if the mark is still valid silent! normal `z