On Tue, Oct 02, 2001 at 12:20:49AM +0200, Piet Delport wrote:
> You can do it a bit more elegantly[1] with this ex one-liner:
> 
> 1;/^$/+1,$!gpg --clearsign


Back in the old days days of PGP 2.x, someone pointed out that you can
use a couple of macros to handle common PGP operations within vi.
Updated for GPG, I find the following in a .exrc (or .vimrc) file to
be useful:

map ^Xe :.,$! gpg -e^M^L
map ^XE :.,$! gpg -es^M^L
map ^Xs :.,$! gpg --clearsign^M^L
map ^Xd :/^-----BEG/,/^-----END/! gpg^M^L
map ^XV :1;/^-----BEG/,/^-----END/w !gpg --verify^M

These do encrypt only, encrypt-sign, sign, decrypt, and verify
signature, respectively.
The ^X, ^M, and ^L should be the single characters CTRL-X, CTRL-M, and
CTRL-L.  An "email signing" macro could be specified as

map ^Xs :1;/^$/+1,$! gpg --clearsign^M^L

Vi on some machines will do confusing things with end of lines on GPG
output.  Vim often works better.

-- 
Wayne Chapeskie
GPG/PGP KeyID: 0xB9D2D272

Reply via email to