.vim/ftplugin/gpg.vim

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

mercurial