Well... it happens that when I copy your script to my archlinux machine, everything works fine.
It also happens that when I copy your script into my ubuntu machine, I had to change both references of `gpg` to `gpg2`, since in ubuntu gpg is not the same program as gpg2. I also would find it convenient to add a `--default-recipient-self` to the `gpg2 -ea` line, but maybe that's just me. If the same change works for you, perhaps you have an "alias gpg=gpg2" in your ~/.bashrc, causing your shell to behave differently that vim? Personally, I use a plugin (https://github.com/jamessan/vim-gnupg) and I have never had problems. Then in my ~/.vimrc, I just had to set: let GPGUsePipes=1 let GPGDefaultRecipients=['my.em...@address.com'] Ryan _______________________________________________ Gnupg-users mailing list Gnupg-users@gnupg.org http://lists.gnupg.org/mailman/listinfo/gnupg-users