Skip to content

Vim Tip of the Week – Encryption : Aug 3, 2007

Well it’s time again for the Vim Tip of the Week. If you missed the previous few tips you might want to look here, here, here. Otherwise let’s get to the good stuff.

vim encryption

If you’ve been a long time reader of this blog you know I’m all about encryption. I still have a lot to learn about it, but I like to use it whenever I can. Encrypting emails. Encrypting network traffic, and with vim, encrypting documents.

From the man page:

Use encryption when writing files.  Will prompt for a crypt key.

To encrypt a document with vim open the new or existing file with:

vim -x [file]

This will prompt you for a passphrase, and only apply the encryption when writing a file.  ie; if you don’t save it or ‘w’rite the file it won’t be applied. Use any passphrase you like and the file will be encrypted to that string. Anytime you open the file after this, even using the normal open method (vim [file]) it will prompt for the password before showing any file contents.

Enjoy a bit more privacy on your machine, and easily encrypt your files with vim.

If this site has been useful, please consider participating in the Fundraiser.

Other Points of Interest

  • No Related Post