1

The plugin gnupg (https://github.com/jamessan/vim-gnupg) worked fine until recently where I get the error:

# vim myfile.asc
Error detected while processing BufReadCmd Autocommands for "*.{gpg,asc,pgp}":
E117: Unknown function: gnupg#init

What would be the origin of this error and how can I make gnupg plugin work?

0
E117: Unknown function: gnupg#init

What would be the origin of this error?

Vim is trying to run a function named gnupg#init() that it will look for in a file named autoload/gnupg.vim under directories listed in 'runtimepath'.

Functions with a # in their name are autoloaded.

Looking at the vim-gnupg plug-in source code, it clearly provides this function, so this should work.

and how can I make gnupg plugin work?

Check that your plug-in installation actually includes this file autoload/gnupg.vim and the function gnupg#init() inside it. You might want to consider reinstalling the plug-in to make sure it is.

Check that the plug-in's base directory is listed in 'runtimepath'. That option is typically managed by your plug-in manager, so make sure this plug-in is properly configured with your plug-in manager so that it will properly register it under 'runtimepath'.

Vim might be having some trouble reading or parsing the autoload/gnupg.vim file, check the output of the :messages command inside Vim to see if Vim reported other errors before this one that might point to the root of the issue.

| improve this answer | |
  • 1
    Other things: scriptnames (and the scriptease equivalent, Scriptnames) help when tracking down loaded scripts. I find new | put =split(&rtp, ',') to be helpful. P.S. # functions don't have to be autoloaded (I've seen some plugins do this... it irks me, but it's technically fine.) – D. Ben Knoble May 7 at 14:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.