vim-gnupg icon indicating copy to clipboard operation
vim-gnupg copied to clipboard

Is it possible to activate the plugin on demand ?

Open FractalWire opened this issue 6 years ago • 3 comments

Hi,

So, if I have a file named 'myFile' that is encrypted but does not finish with .gpg, .pgp ar .asc, is it possible, once I start editing it to enable the plugin ? So that I can see the unencrypted version of the file and save my possible changes.

Thanks

FractalWire avatar Apr 10 '18 19:04 FractalWire

The plugin currently requires that the filename matches a known pattern. It shouldn't be too difficult to add a :GPGDecrypt command to decrypt an unrecognized buffer.

There would need to be some additional work to handle saving, since that also expects a certain filename pattern. This could possibly be simplified to check for a buffer-local variable that the buffer is the result of decrypting a file.

There should probably also be a :GPGEncrypt command for the flip side of working with a new, unencrypted buffer and saving it as an encrypted file that doesn't match the expected filename pattern.

jamessan avatar Apr 20 '18 14:04 jamessan

Or. Better. Just have a configuration where you can specify file types that you want to encrypt.

omarabid avatar Jun 17 '19 10:06 omarabid

Or. Better. Just have a configuration where you can specify file types that you want to encrypt.

g:GPGFilePattern already allows to configure this, so you could either configure it in your .vimrc, or a wrapper could temporarily set the pattern to *.

ThomasAH avatar Jul 03 '19 13:07 ThomasAH