vimであなたのために暗号化することができます。
あなたのgpg暗号化手段を介してコンテンツをフィルタリングし、vimの中のファイルを保存する前に:
:{range}![!]{filter} [!][arg] *:range!*
Filter {range} lines through the external program
{filter}. Vim replaces the optional bangs with the
latest given command and appends the optional [arg].
Vim saves the output of the filter command in a
temporary file and then reads the file into the
buffer. Vim uses the 'shellredir' option to redirect
the filter output to the temporary file.
However, if the 'shelltemp' option is off then pipes
are used when possible (on Unix).
When the 'R' flag is included in 'cpoptions' marks in
the filtered lines are deleted, unless the
|:keepmarks| command is used. Example: >
:keepmarks '<,'>!sort
<
When the number of lines after filtering is less than
before, marks in the missing lines are deleted anyway.
w
あなたはGPGを通してそれをフィルタリングするのであれば、(私はここのフラグで推測している):
:%!gpg -q -d -p $password
:w $filename
あなたはvimの中にそれらを使用したい場合はそう Vimはそれらへのアクセスを持っている
$password
と
$filename
環境変数をエクスポートする必要があります
。
パスフレーズでパス名展開とワード分割を実行するのは、本当に悪い考えです。 http://mywiki.wooledge.org/BashGuide/Practices/Quoting-Quoteすべてのパラメータ拡張( "$ passw"、 "$ filename"、..) – lhunath
@lhunath、@Paul Tarjan:または単に移行する'' zsh'へ。 'command $ var'を使うと、デフォルトではパス名展開と単語分割は実行されません。ここでは' command '$ var "'と完全に等価です。 。 – ZyX
@Paulはまだ利用可能なスクリプトですか?リンクが壊れています... – Simon