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

Decrypt and Open Encrypted File into Vim

In your shell config:

vimdecrypt() { gpg -d "$1" | vim - -n -i "NONE" "+set filetype=$2"; }

Now you can type:

vimdecrypt my_secure_file.txt.gpg

Note: This will NOT decrypt into a file, will NOT open a swap file, and NOT write to .viminfo. There will be no trace of the file other than what's in vim's memory space.

Explanation of parameters are 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