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?

1
  • 2
    check that the plugin is correctly installed May 7, 2020 at 20:41

1 Answer 1

1
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.

1
  • 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, 2020 at 14:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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