.vimrc

changeset 414
9536ca40b624
parent 409
ef7a3edc69e9
child 416
ef460163c246
--- a/.vimrc
+++ b/.vimrc
@@ -347,6 +347,15 @@ augroup vimrc
   autocmd BufLeave *.js                normal! mJ
   autocmd BufLeave *.pl,*.pm           normal! mP
 augroup END
+
+" https://mjj.io/2015/01/27/encrypting-files-with-gpg-and-vim/
+augroup encrypted
+  autocmd!
+  autocmd BufReadPre,FileReadPre *.gpg set noswapfile noundofile nobackup viminfo=
+  autocmd BufReadPost *.gpg :%!gpg --decrypt 2> /dev/null
+  autocmd BufWritePre *.gpg :%!gpg -se -a --default-recipient-self
+  autocmd BufWritePost *.gpg u
+augroup END
 "}}}
 
 

mercurial