- Clone this vim-gnupg plugin.
- Put the .vim file somewhere.
- Edit your .vimrc and tell it to source the file and…
- (optionally) Tell it what key to use as a default recipient:
let GPGDefaultRecipients="7F8BBB62DB0B51FA" source ~/.vim/autoload/gnupg.vim
Ta-da. You can now “vim somefile.gpg” on the commandline and it will automagically decrypt and edit the file, then re-encrypt it when you save or save-exit.