gpg + vimwiki

Thu, 31 Aug 2017 17:41:31 -0400

author
Meredith Howard <mhoward@roomag.org>
date
Thu, 31 Aug 2017 17:41:31 -0400
changeset 638
a011c7252d25
parent 637
9b35b49a39fd
child 639
383628663fd5

gpg + vimwiki

.vimrc file | annotate | diff | comparison | revisions
--- a/.vimrc
+++ b/.vimrc
@@ -290,12 +290,13 @@ augroup AutoMkdir
 augroup END
 
 " https://mjj.io/2015/01/27/encrypting-files-with-gpg-and-vim/
+" hacked to work with vimwiki
 augroup encrypted
   autocmd!
-  autocmd BufReadPre,FileReadPre *.gpg set noswapfile noundofile nobackup viminfo=
-  autocmd BufReadPost *.gpg :%!GPG_TTY=/dev/tty gpg2 --decrypt 2> /dev/null
-  autocmd BufWritePre *.gpg :%!GPG_TTY=/dev/tty gpg2 -se -a --default-recipient-self
-  autocmd BufWritePost *.gpg u
+  autocmd BufReadPre,FileReadPre *.gpg,*.gpg.wiki setl noswapfile noundofile nobackup viminfo=
+  autocmd BufReadPost *.gpg,*.gpg.wiki :sil %!GPG_TTY=/dev/tty gpg2 --decrypt 2> /dev/null
+  autocmd BufWritePre *.gpg,*.gpg.wiki :sil %!GPG_TTY=/dev/tty gpg2 -se -a --default-recipient-self
+  autocmd BufWritePost *.gpg,*.gpg.wiki :sil undo
 augroup END
 "}}}
 

mercurial