.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

" based on
" https://mjj.io/2015/01/27/encrypting-files-with-gpg-and-vim/
" hacked to work with vimwiki
" moved to ftplugin

setl noswapfile noundofile nobackup viminfo=

sil %!GPG_TTY=/dev/tty gpg2 --decrypt 2>/dev/null

augroup GPGWriteEncrypted
  autocmd!
  autocmd BufWritePre *.gpg,*.gpg.wiki :sil %!GPG_TTY=/dev/tty gpg2 -se -a --default-recipient-self 2>/dev/null
  autocmd BufWritePost *.gpg,*.gpg.wiki :sil undo
augroup END

mercurial