From 1e5a796e0b5ec899104f3615d371d98185274683 Mon Sep 17 00:00:00 2001 From: Markus Braun Date: Tue, 16 Feb 2010 07:31:53 +0000 Subject: [PATCH] Patch by James Vega Default to g:GPGPreferArmor = 1 for "*.asc" files if g:GPGPreferArmor is not set by the user. --- plugin/gnupg.vim | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/plugin/gnupg.vim b/plugin/gnupg.vim index fa12d53..7e74af1 100644 --- a/plugin/gnupg.vim +++ b/plugin/gnupg.vim @@ -71,7 +71,8 @@ " 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. +" If set to 1 armored data is preferred for new files. Defaults to 0 +" unless a "*.asc" file is being edited. " " g:GPGPreferSign " If set to 1 signed data is preferred for new files. Defaults to 0. @@ -82,7 +83,7 @@ " " Known Issues: {{{2 " -" In some cases gvim can't decryt files +" In some cases gvim can't decrypt 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 @@ -197,7 +198,12 @@ function s:GPGInit() " check if armored files are preferred if (!exists("g:GPGPreferArmor")) - let g:GPGPreferArmor = 0 + " .asc files should be armored as that's what the extension is used for + if expand('') =~ '\.asc$' + let g:GPGPreferArmor = 1 + else + let g:GPGPreferArmor = 0 + endif endif " check if signed files are preferred