Add Password Protection to a file your editing in vim.

vim -x <FILENAME>
While I love gpg and truecrypt there's some times when you just want to edit a file and not worry about keys or having to deal needing extra software on hand. Thus, you can use vim's encrypted file format. For more info on vim's encrypted files visit: http://www.vim.org/htmldoc/editing.html#encryption
Sample Output
~
~
~
Enter encryption key:

88
By: denzuko
2009-05-05 23:24:17

What Others Think

Shouldn't that be 'vim -x '? 'vim -e' puts you into ex mode...
mayersj1 · 865 weeks and 6 days ago
@mayersjl thanks, I'll fix that up for everyone @mpb Glad I could help.
denzuko · 865 weeks and 6 days ago
Note that the encryption vim uses is really weak, so it is not really an alternative to gpg and the likes (this is also noted in the documentation linked). That said, it is useful for quick and dirty obfuscation :)
spatz · 865 weeks and 5 days ago
You're, not 'Your'.
vim99 · 355 weeks and 4 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: