Last Updated: February 25, 2016
·
1.869K
· jasonseney

Encrypt and Save a File with GPG and Vim

From within vim:

:w !gpg -c -o myfile.txt.gpg

Or add a command to your .vimrc:

command -nargs=1 WriteEncrypted w !gpg -c -o <q-args>

So you can then simply type:

WriteEncrypted myfile.txt.gpg

Detailed explanation of parameters here:

http://jasonseney.com/post/18646147210/open-edit-save-encrypted-files-with-vim-and-gpg

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

Most application security programs still stop at the repository. The page a visitor loads can run third-party scripts that read the DOM, change a checkout, or steal a session after the deploy already looks clean.

Security insights from Cside