jamessan / vim-gnupg

This script implements transparent editing of gpg encrypted files.
http://www.vim.org/scripts/script.php?script_id=3645
728 stars 73 forks source link

No matching autocommands #30

Closed Enrico68 closed 9 years ago

Enrico68 commented 9 years ago

Whenever I try open a file I have this error

No matching autocommands
Message could not be decrypted! (Press ENTER)

On emacs file is open correctly

I am using MacOS 10.9.5

jamessan commented 9 years ago

The No matching autocommands isn't relevant. That's just something I need to silence.

For the second one, run

let g:GPGDebugLevel=3
let g:GPGDebugLog='/path/to/some/logfile.txt'

before trying to open the encrypted file. Then post the contents of /path/to/some/logfile.txt here.

Enrico68 commented 9 years ago

GnuPG: >>>>>>>> Entering s:GPGInit(1) GnuPG: >>>>>>>> Entering s:GPGDecrypt(1) GnuPG: command: LANG=C LC_ALL=C gpg --trust-model always --use-agent --verbose --decrypt --list-only --dry-run --batch --no-use-agent --logger-fd 1 '/Users/enricopirani/.mailpass.gpg' 2>/dev/null GnuPG: rc: 0 GnuPG: output: gpg: public key is 0A8DC854^@ GnuPG: this file is asymmetric encrypted GnuPG: recipient is 0A8DC854 GnuPG: >>>>>>>> Entering s:GPGNameToID() GnuPG: command: LANG=C LC_ALL=C gpg --trust-model always --use-agent --quiet --with-colons --fixed-list-mode --list-keys '0A8DC854' 2>/dev/null GnuPG: rc: 0 GnuPG: output: tru:t:1:1420198286:1439900531:3:1:5^@pub:u:2048:1:9049A53B841DD5CD:1409815402:::u:::scESC:^@uid:u::::1409815402::08C4E8E0A1484817682428B4BDDE4CF97B710CEE::Enrico Pirani (Medico) enrico.pirani@gmail.com:^@sub:u:2048:1:1DEDF4B30A8DC854:1409815402::::::e:^@ GnuPG: <<<<<<<< Leaving s:GPGNameToID() GnuPG: name of recipient is 9049A53B841DD5CD GnuPG: called BufReadPre autocommand for .mailpass GnuPG: decrypting file GnuPG: command: silent r !LANG=C LC_ALL=C gpg --trust-model always --use-agent --quiet --decrypt '/Users/enricopirani/.mailpass.gpg' 2>/dev/null GnuPG: rc: 2 GnuPG: <<<<<<<< Leaving s:GPGDecrypt()

jamessan commented 9 years ago

Hmm, at a glance, it looks like gpg when run from Vim can't communicate with your gpg agent. Could you try doing let g:GPGUseAgent=0 before opening the file?

Enrico68 commented 9 years ago

It workss! Thanks James

jamessan commented 9 years ago

The autocommand warning is fixed in dd8e4adb4d.