Tip #371: Encrypting a file within vim session and not leaving behind traces.
tip karma |
Rating 7/4, Viewed by 275
|
created: |
|
November 20, 2002 21:44 |
|
complexity: |
|
basic |
author: |
|
Prakash Patil |
|
as of Vim: |
|
6.0 |
I was desperately looking for a simple way to encrypt files.
(I find this very useful. Despite all the user permissions you set, it's easy for someone/admin
to do sudo and read your personal files..Many work environments provide users the permission
to sudo or become super user)
Vim let's you encrypt file within the edit session.
:X
Will prompt for encryption key. Enter the encryption key and REMEMBER to save
it using :w. That will encrypt the file.
Try
:help :X
for more info.
If you don't want to leave behind traces of your edits:
By default, once you finish your vim session, ~/.viminfo will be written with
the files you edited (marks), commands you entered and possibly what you wrote
(the registers you copied or pasted...). If you don't want such trace to be left behind,
then place the following file in in your .vimrc
set viminfo='0,\"0,\/0,:0,f0
<<always cd to the current file's directory |
Remove unwanted empty or blank lines for english and chinese >>
Additional Notes
|