On Thu, Aug 27, 2009 at 03:27:10PM -0600, Kenneth Burgener wrote:
> My favorite method is a basic bash script that:
> 
> 1. asks for a password
> 2. gpg decrypt a password file
> 3. opens password file via vi
> 4. allow me to edit
> 5. upon save and close, gpg re-encrypts the password file.

So, even simpler and more secure is a snippet like this in your .vimrc:

if has("autocmd")
    " gpg encrypted files
    if exists("$KEY")
        autocmd BufNewFile,BufReadPre *.gpg :set secure viminfo= noswapfile 
nobackup nowritebackup       \history=0 binary
        autocmd BufReadPost *.gpg :%!gpg -d 2>/dev/null
        autocmd BufWritePre *.gpg :%!gpg -e -r $KEY 2>/dev/null
        autocmd BufWritePost *.gpg u
    endif
endif

-- 
Byron Clark


/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/

Reply via email to