Ⅰ. 插件描述
Plugin for transparent editing of gpg encrypted files.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'embear/gnupg'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'embear/gnupg'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'embear/gnupg'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/gnupg
Ⅳ. 文档说明
Due to the lack of time I'm not able to continue the development of this script.
James McCoy took over development. New versions can be found at vimscript #3645.
This script implements transparent editing of gpg encrypted files. The filename must have a ".gpg", ".pgp" or ".asc" suffix. When opening such a file the content is decrypted, when opening a new file the script will ask for the recipients of the encrypted file. The file content will be encrypted to all recipients before it is written. The script turns off viminfo and swapfile to increase security.
Commands:
:GPGEditRecipients
Opens a scratch buffer to change the list of recipients. Recipients that
are unknown (not in your public key) are highlighted and have
a prepended "!". Closing the buffer makes the changes permanent.
:GPGViewRecipients
Prints the list of recipients.
:GPGEditOptions
Opens a scratch buffer to change the options for encryption (symmetric,
asymmetric, signing). Closing the buffer makes the changes permanent.
WARNING: There is no check of the entered options, so you need to know
what you are doing.
:GPGViewOptions
Prints the list of options.
Variables:
g:GPGExecutable
If set used as gpg executable, otherwise the system chooses what is run
when "gpg" is called. Defaults to "gpg".
g:GPGUseAgent
If set to 0 a possible available gpg-agent won't be used. Defaults to 1.
g:GPGPreferSymmetric
If set to 1 symmetric encryption is preferred for new files. Defaults to 0.
g:GPGPreferArmor
If set to 1 armored data is preferred for new files. Defaults to 0.
g:GPGPreferSign
If set to 1 signed data is preferred for new files. Defaults to 0.
g:GPGDefaultRecipients
If set, these recipients are used as defaults when no other recipient is
defined. This variable is a Vim list. Default is unset.
Known Issues:
In some cases gvim can't decryt files
This is caused by the fact that a running gvim has no TTY and thus gpg is
not able to ask for the passphrase by itself. This is a problem for Windows
and Linux versions of gvim and could not be solved unless a "terminal
emulation" is implemented for gvim. To circumvent this you have to use any
combination of gpg-agent and a graphical pinentry program:
- gpg-agent only:
you need to provide the passphrase for the needed key to gpg-agent
in a terminal before you open files with gvim which require this key.
- pinentry only:
you will get a popup window every time you open a file that needs to
be decrypted.
- gpgagent and pinentry:
you will get a popup window the first time you open a file that
needs to be decrypted.