One of those "I never knew it could do this" things.
Starting vim with the -x flag will prompt you for an encryption key. After you enter it twice, vim will encrypt the file. If you later vim the file, vim will discover the file is encrypted (because a magic is prepended) and prompt for the key.
Vim does the right thing in terms of also encrypting the .swp file. However, there are some caveats/details
By default, vim uses the 'zip' algorithm which is extremely insecure. However,
set cm=blowfish
in your .vimrc will force it to use blowfish.
Also, your .viminfo may leak text you copy/delete. At a minimum you need to turn off registers. I would probably create an alias or a small shell script that verifies the correct cm= line is in .vimrc and sets the registers (see this). e.g., a script called 'vie' that does that and then invokes vim.
Finally, the vim folks don't appear to be very confidant in their crypto:
The encryption in Vim has not been tested for robustness.
For more details, see this part of the vim docs.
Starting vim with the -x flag will prompt you for an encryption key. After you enter it twice, vim will encrypt the file. If you later vim the file, vim will discover the file is encrypted (because a magic is prepended) and prompt for the key.
Vim does the right thing in terms of also encrypting the .swp file. However, there are some caveats/details
By default, vim uses the 'zip' algorithm which is extremely insecure. However,
set cm=blowfish
in your .vimrc will force it to use blowfish.
Also, your .viminfo may leak text you copy/delete. At a minimum you need to turn off registers. I would probably create an alias or a small shell script that verifies the correct cm= line is in .vimrc and sets the registers (see this). e.g., a script called 'vie' that does that and then invokes vim.
Finally, the vim folks don't appear to be very confidant in their crypto:
The encryption in Vim has not been tested for robustness.
For more details, see this part of the vim docs.