.vim/ftplugin/gpg.vim

Sat, 16 Mar 2019 04:30:15 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Sat, 16 Mar 2019 04:30:15 -0500
changeset 747
a3c2fbf5a623
parent 746
63fedee268a7
permissions
-rw-r--r--

disable ansi perldoc until consistent

746
63fedee268a7 move to gpg ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
1 " based on
63fedee268a7 move to gpg ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
2 " https://mjj.io/2015/01/27/encrypting-files-with-gpg-and-vim/
63fedee268a7 move to gpg ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
3 " hacked to work with vimwiki
63fedee268a7 move to gpg ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
4 " moved to ftplugin
63fedee268a7 move to gpg ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
5
63fedee268a7 move to gpg ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
6 setl noswapfile noundofile nobackup viminfo=
63fedee268a7 move to gpg ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
7
63fedee268a7 move to gpg ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
8 sil %!GPG_TTY=/dev/tty gpg2 --decrypt 2>/dev/null
63fedee268a7 move to gpg ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
9
63fedee268a7 move to gpg ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
10 augroup GPGWriteEncrypted
63fedee268a7 move to gpg ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
11 autocmd!
63fedee268a7 move to gpg ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
12 autocmd BufWritePre *.gpg,*.gpg.wiki :sil %!GPG_TTY=/dev/tty gpg2 -se -a --default-recipient-self 2>/dev/null
63fedee268a7 move to gpg ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
13 autocmd BufWritePost *.gpg,*.gpg.wiki :sil undo
63fedee268a7 move to gpg ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
14 augroup END

mercurial