TL;DR; With the
-x flag Vim will encrypt whatever file you open with a passphrase.
Did you know that Vim can encrypt files?
That’s right, one of the awesome features of Vim is that it supports encrypting text files simply with the
Lately I’ve been searching for a better password manager to use. I’ve used 1Password on my Mac, Password Gorilla on my Linux machine and some other program that I can’t remember right now on my Windows machine. They all work great for basic username-password style accounts, but what about my server logins, ssh keys and the various other authentication methonds I use? The only application that supported these well enough was 1Password, but I didn’t particularly want to buy it again to run it on Windows, and there is no 1Password client for Linux. To add to the havoc, I also wanted access to everything on my Android phone.
After deciding that the combinations of password managers wasn’t going to work for me, I began to look for an alternative. It had to work across Mac, Windows, Linux and Android and support authentication utilities outside of just username-password methods. I also wanted to be able to dump whatever kind of information I needed to in with the password: IP, hostname, services installed for quick access, etc. It was amazing how quickly I found Vim as an option; in fact I stumbled upon the option as I was looking at someone’s dotfiles (I wish I could remember who’s so I could credit them). In the dotfiles I say a setting to use Blowfish from within Vim:
My password file is very simple, because I don’t have to conform to a specific format. The only thing I do is put whatever name I want to call the authentication data and then indent the actual information, so my password file looks something like this:
I just drop that in Dropbox and poof! My Password manager is everywhere Vim is, which is everywhere. I have access to my passwords on all my desktops and my phone.