Mon, 10 Oct 2016 01:14:22 -0400
add gpg edit helper
.vimrc | file | annotate | diff | comparison | revisions |
--- 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 "}}}