Tip of the day: Using GPG trasparently in vim
Submitted by marineam on Tue, 08/19/2008 - 00:54.
Vim's built in encryption feature is pretty handy but it's algorithm is only strong enough to protect against a casual observer. For good encryption something else is required but I still want something that is fairly transparent. I've come up with a little solution using GnuPG, just add the following to your .vimrc to automatically encrypt and decrypt *.gpg files. (Replace my key id with yours of course)
au BufNewFile,BufReadPre *.gpg :set secure viminfo= noswapfile nobackup nowritebackup history=0 binary au BufReadPost *.gpg :%!gpg -d 2>/dev/null au BufWritePre *.gpg :%!gpg -e -r CB06CE30 2>/dev/null au BufWritePost *.gpg u
»
- Login to post comments