File:  [PGP] / pgp / contrib / vi / vipgp.doc
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:39:03 2018 UTC (8 years, 1 month ago) by root
Branches: phill, MAIN
CVS tags: pgp23a, pgp22, HEAD
PGP 2.2

Here are some vi macros, you can use these to encrypt, sign, decrypt or
view PGP messages from vi.  They are all invoked by typing Ctrl-X followed
by one of the letters e,s,d or v.  The encrypt/sign macros work from
the current cursor position to the end of the file, for the decrypt/sign
macros you should position the cursor before the PGP armored block you
want to decrypt/view.

If the PGP command fails, for instance because you typed the wrong userid
for encryption, you should type u when you're back in vi to undo the change.

These macros should be added to your .exrc file.  If you don't have a .exrc
file, you can create one by typing:

echo $EXINIT >$HOME/.exrc

You should also make sure that the EXINIT environment variable isn't set
in your shell startup file (.profile .login .cshrc etc.).

-----cut here-----
map e :,$! /bin/sh -c 'pgp -feast 2>/dev/tty||sleep 4'

map s :,$! /bin/sh -c 'pgp -fast +clear 2>/dev/tty'

map d :/^-----BEG/,/^-----END/! /bin/sh -c 'pgp -f 2>/dev/tty||sleep 4'

map v :,/^-----END/w !pgp -m

-----cut here-----

The macros can be used with [t]csh and Bourne-type shells, the latter don't
need the /bin/sh -c '..' wrapper.

Here is another macro, only useful if you use MH.  You can use it to
include an encrypted message you are replying to.

-----cut here-----
map i :r! /bin/sh -c 'pgp -f <@ 2>/dev/tty|sed -e "s/^/>/"'

-----cut here-----

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.