Encrypt or password protect a document
While editing a document, just issue :X and you will then be prompted to enter a key (password).
After saving your document, when you open it again, you will have to enter the password.
To remove the encryption, open your document with the correct password and issue :set key= and that will remove it.
[Click to add or edit comments])
Please prepend comments below including a date