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

Encrypt to clipboard

Open nyarly opened this issue 11 years ago • 3 comments

A command to encrypt the current buffer to the clipboard would be really helpful

nyarly avatar Feb 14 '14 20:02 nyarly

Can you clarify what functionality you're asking for? Do you simply want Vim to copy the contents of the already encrypted file on disk into the clipboard?

jamessan avatar Feb 18 '14 20:02 jamessan

Ideally, I'd like to be able to edit a buffer, copy the encrypted version to the clipboard without writing a file. Currently using xsel; rm for the task. On Feb 18, 2014 12:07 PM, "James McCoy" [email protected] wrote:

Can you clarify what functionality you're asking for? Do you simply want Vim to copy the contents of the already encrypted file on disk into the clipboard?

— Reply to this email directly or view it on GitHubhttps://github.com/jamessan/vim-gnupg/issues/15#issuecomment-35427337 .

nyarly avatar Feb 18 '14 20:02 nyarly

You could do this with :w !gpg --armor --encrypt --output - | xsel.

I'll think about adding a :GPGArmor command or some such to turn the buffer (or create a new buffer) into an encrypted/armored version of itself. Then you could either use Vim's own mechanisms to interact with the clipboard or feed it to xsel.

jamessan avatar Mar 22 '15 03:03 jamessan