From: Antonio Ospite Date: Wed, 8 Jun 2016 13:52:03 +0000 (+0200) Subject: signature_block.vim: refresh examples X-Git-Tag: 0.2~3 X-Git-Url: https://git.ao2.it/vim/signature_block.vim.git/commitdiff_plain/ac613c53c18d5da96dddd267342f204623253633 signature_block.vim: refresh examples Show how to write the buffer ONLY when the new signature has been added, and show a possible use of ReplaceLastSignature() --- diff --git a/plugin/signature_block.vim b/plugin/signature_block.vim index d7eb8e0..7aff4db 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: