[clug] transparent gpg in vim

Eyal Lebedinsky eyal at eyal.emu.id.au
Sun Feb 14 08:06:38 UTC 2016

I am using this feature for a few years happily. My .vimrc was from here (a long time ago):

Today I found that I have a problem when I used it in a VM, where I thought it worked before.

I can easily open a gpg encrypted file. No problem.
When I write the file the prompts for a passphrase come up as expected. However, the saved file is much larger
than I expected. running 'file' on it says 'data' while on a proper gpg file it knows it is.

When I open the saved file it does not ask for the passphrase, but shows
	"test.gpg" 3L, 759C
	shell returned 2
	3 lines filtered
	Press ENTER or type command to continue

The opened file is empty.
The original file has only two words, gpg encrypted it is about 80 bytes, the badly saved one is 77 bytes.

Another point. Initially even this did not work. I did not have any pub/sec keyrings, so when saving (in vim) I got a prompt
(probably from gpg):
	You did not specify a user ID, (you may use "-r")
	Current recipients:
	Enter the user ID, End with an empty line:

I did not know how to respond. Do I did a 'gpg --gen-key' with fake data and got the behavior described at the top.

Finally, should I switch to using 'vim -x' with 'cryptmetod="blowfish2"'? I use it to keep my passwords file
(no need to discuss other ways of addressing this need). The nice thing about what I use is that I can always
{en,de}crypt with 'gpg' when I do not have access to vi.

Eyal Lebedinsky (eyal at eyal.emu.id.au)

More information about the linux mailing list