jamessan / vim-gnupg

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

Added global boolean variable g:GPGPreferGPG2 to prefer gpg2 over gpg #90

Closed blackjackshellac closed 6 years ago

blackjackshellac commented 6 years ago

Since the --trust-model always option is specified as part of g:GPGExecutable, I thought toggling the use of gpg2 would be simpler than changing the value of g:GPGExecutable,

To enable turn on the value in ~/.vimrc,

let g:GPGPreferGPG2 = 1

jamessan commented 6 years ago

Either way requires adding a variable to your vimrc. Is your concern with changing g:GPGExecutable due to the risk that that would prevent you from getting any future changes to the default value?

blackjackshellac commented 6 years ago

The main reason is that this way you don't know the value of the default options to GPGExecutable, unless you dig through the code. To be honest I don't really know what the effect of setting g:GPGExecutable=gpg2 without the --trust-model always option set. This approach absolves the user of that complexity.

jamessan commented 6 years ago

The main reason is that this way you don't know the value of the default options to GPGExecutable, unless you dig through the code

True, but the same would be the case for this new variable, since all the documentation is currently in the plugin itself.

The use of --trust-model always is to avoid the (potentially costly) trustdb check that periodically happens when gpg is invoked.

The default value for g:GPGExecutable is never going to change, including the one argument that accompanies it. Instead I have plans for deprecating g:GPGExecutable in favor of separating the binary name and the default arguments, since that would avoid the current problem.

I appreciate the effort to make the switch to gpg2 easier, but given the above reasons I don't think adding a new variable is worth the effort.