X-Git-Url: https://git.ao2.it/vim/signature_block.vim.git/blobdiff_plain/b7fd78cba105d437fc2b6230c2e7a4f110e2d163..HEAD:/plugin/signature_block.vim?ds=sidebyside diff --git a/plugin/signature_block.vim b/plugin/signature_block.vim index d7eb8e0..156cb18 100644 --- a/plugin/signature_block.vim +++ b/plugin/signature_block.vim @@ -1,11 +1,18 @@ "--------------------------------------------------------------------------- " Vim global plugin for adding and manipulating signature blocks in e-mails -" Maintainer: Antonio Ospite -" Version: 0.1 -" Last Change: 2009-11-24 +" Maintainer: Antonio Ospite +" Version: 0.2 +" Last Change: 2016-06-08 " License: This script is free software; you can redistribute it and/or " modify it under the terms of the GNU General Public License. " +" History: +" 1.0: Initial upload +" 2.0: +" - Check that the signature file is readable before removing the old +" signature and append the new one. +" - Minor fixes. +" " Install Details: " Drop this file into your $HOME/.vim/plugin directory. " @@ -15,16 +22,21 @@ " 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: " http://en.wikipedia.org/wiki/Signature_block " http://tools.ietf.org/html/rfc1855 " +" The latest version of this script is available at these locations: +" https://git.ao2.it/vim/signature_block.vim.git +" http://www.vim.org/scripts/script.php?script_id=2872 +" https://github.com/vim-scripts/signature_block.vim +" "--------------------------------------------------------------------------- if exists("g:loaded_signaturePlugin") | finish | endif @@ -105,7 +117,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 +145,7 @@ func! ReplaceLastSignature(sigfile) endtry call AppendSignature(a:sigfile) - + " restore cursor position from mark 'z' if the mark is still valid silent! normal `z