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
Written by Jason Seney
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#