Commit Graph

94 Commits

Author SHA1 Message Date
Markus Braun
921d99fd88 Use echom instead of plain echo
This way warnings and errors are stored in message list.
2011-07-06 08:05:37 +02:00
Markus Braun
6fdd1667ec Patch by Giel van Schijndel to get GPG_TTY dynamically:
Hi,

      I'm using your gnupg Vim script [1] and found a minor problem involving
      GPG_TTY not being set, which is no problem on my system because I use
      pinentry-gtk to get passphrases with.

      Secondly it is possible to use whatever tty is current by using the
      output from the `tty' command.

      Thus I have made a patch that addresses this problem. See attached.

      [1] http://www.vim.org/scripts/script.php?script_id=661

      --
      Giel
2011-07-06 08:05:37 +02:00
Markus Braun
cce39d13b2 Give Karl-Heinz Ruskowski his credit. 2011-07-06 08:05:36 +02:00
Markus Braun
c7ab1464da Patch from Karl-Heinz Ruskowski.
Here his message:

      Hallo,
      uns sind hier zwei Fehler an dem gnupg.vim-script aufgefallen die wir hier
      erstmal vorsorglich umgangen haben. (Patch hängt an)

      1. Wenn wenn Einträge in der in der Empfängerliste waren die einen Trustlevel
      < 4 hatten frage Gnupg nochmal nach ob denn nun dieser Schlüssel übernommen
      werden sollte wenn man dies verneinte wurde die Datei dennoch gespeichert,
      aber unverschlüsselt - was sicher die schlechteste lösung ist.
      Kleiner auszug aus der Schell darüber:
      =========================================
      pub  1024g/6E4DF128 2006-12-06 Sascha L. Teichmann
      <s-l-teichmann@users.sourceforge.net>
      Haupt-Fingerabdruck  = 4F52 9526 6786 0497 4390  676F B2BB CE94 57FC 1337
      Unter-Fingerabdruck  = AD32 F49A C4AD 7113 CF0D  0303 548A 53F3 6E4D F128

      It is NOT certain that the key belongs to the person named
      in the user ID.  If you *really* know what you are doing,
      you may answer the next question with yes.

      Use this key anyway? (y/N)

      --> Vorgabe (also nein) führt zu

      "Zugang/Zugang.gpg" 0L, 0C geschrieben
      =========================================

      Mittels "--trust-model always" erzwingen wir die zustimung und die Daten
      bleiben verschlüsselt.

      2. Wenn man die Empfänger einer Datei bearbeitet hat und man verlässt den
      Puffer zur eingabe und nun wird ein eingetragener Schlüssel gelöscht
      speichert man wieder eine kaputte gpg Datei.

      Ich habe eine zusätzliche prüfung auf unbekannte Empfänger hinzugefügt und
      lösche diese Unbekannten Keys vor er verschlüsselung.

      In beiden fällen war es mir nicht möglich bei einem aufgetretenen Fehler
      wieder zurück in den Editormodus zu wechseln, was sicher an meinen schlechten
      Vimscript Kenntnissen liegt. Dies wäre aus meiner Sicht natürlich die beste
      Lösung.

      Hoffe ich konnte helfen.

      Mit freundlichen Grüßen

      Karl-Heinz Ruskowski
      --
      Karl-Heinz Ruskowski                              OpenPGP key: FB8DA3BF
      Intevation GmbH, Osnabrück
      Amtsgericht Osnabrück, HR B 18998             http://www.intevation.de/
      Geschäftsführer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner
2011-07-06 08:05:36 +02:00
Markus Braun
9cb02c800a Vim version compatibility
Wrap winsaveview() and winrestview() with v:version > 700 to make the plugin run under older vim versions.
2011-07-06 08:05:36 +02:00
Markus Braun
9f4f083367 Little reindenting. 2011-07-06 08:05:36 +02:00
Markus Braun
febf2d4685 Changed recipient and option buffer handling
This allows ':w' to close (besides ':q' and ':x')
2011-07-06 08:05:36 +02:00
Markus Braun
6a32435246 Revert last commit. 2011-07-06 08:05:36 +02:00
Markus Braun
de5ea9f6bd New commands ":GPGRecipients" and ":GPGOptions"
Aliases for ":GPGEditRecipients" and ":GPGEditOptions" for better tab completion.
2011-07-06 08:05:36 +02:00
Markus Braun
b98c3fbd4a Convert the output of gpg to the correct encoding. 2011-07-06 08:05:36 +02:00
Markus Braun
ac6ec713e6 Added an option to set the gpg executable. 2011-07-06 08:05:35 +02:00
Markus Braun
fceb8855f9 Save/restore view of saved window instead of cursor position. 2011-07-06 08:05:35 +02:00
Markus Braun
bfdc09a732 Print debug message only after debug level had been defined. 2011-07-06 08:05:35 +02:00
Markus Braun
874bd187f2 Made gnupg.vim hopefully encoding safe, needs testing. 2011-07-06 08:05:35 +02:00
Markus Braun
479e79d3be Print plugin version in verbose mode 2011-07-06 08:05:35 +02:00
Markus Braun
acdf9e096d Restructured autocommand triggers, merged in functions. 2011-07-06 08:05:35 +02:00
Markus Braun
5aabc38ec2 Restore cursor position after write. 2011-07-06 08:05:35 +02:00
Markus Braun
780d1ed91e Make use of "--list-only" option. 2011-07-06 08:05:35 +02:00
Markus Braun
f5e107f596 Added a debug command and some debug messages 2011-07-06 08:05:35 +02:00
Markus Braun
c069e0f21d Modified to work with gpg2 correctly. 2011-07-06 08:05:34 +02:00
Markus Braun
bf868fb9a1 Use revision number for multiple load guard. 2011-07-06 08:05:34 +02:00
Markus Braun
f786031299 Ignore tty for gvim 2011-07-06 08:05:34 +02:00
Markus Braun
63dff1cd4b shellredir wasn't restored.
Instead of restore it was set again to s:shellredir
2011-07-06 08:05:34 +02:00
Markus Braun
f9a81fc1bd Set LC_ALL also, to ensure english messages of gpg. 2011-07-06 08:05:34 +02:00
Markus Braun
eb2fb27748 Added variables g:GPGPreferSymmetric and g:GPGPreferArmor. 2011-07-06 08:05:34 +02:00
Markus Braun
fc79049481 Bind highlight to standard highlighting. 2011-07-06 08:05:34 +02:00
Markus Braun
ae76dffaed Correction in documentation 2011-07-06 08:05:34 +02:00
Markus Braun
60b7fb1ede Aotocommand rework
Make GPGFinish*() more robust, change to window if closed from another.
Also install autocmd in GPGEdit*() if we split an existing buffer.
2011-07-06 08:05:33 +02:00
Markus Braun
621813ef6e Make GPGEdit* commands more robust. 2011-07-06 08:05:33 +02:00
Markus Braun
ac21a24b3d Better escaping file names with spaces 2011-07-06 08:05:33 +02:00
Markus Braun
9a15ce7ef1 Only undo encryption of buffer content for encrypted files. 2011-07-06 08:05:33 +02:00
Markus Braun
4771cc9025 Edit unencrypted files with "encryption" suffix as normal files. 2011-07-06 08:05:33 +02:00
Markus Braun
9a272dbf45 Some fixes for windows. 2011-07-06 08:05:33 +02:00
Markus Braun
ca35a3b51d Documentation and credits update. 2011-07-06 08:05:33 +02:00
Markus Braun
9f3b48757c Added '.asc' suffix. 2011-07-06 08:05:33 +02:00
Markus Braun
0e6b891b8e Make symmetric encryption working again. 2011-07-06 08:05:33 +02:00
Markus Braun
bc2f74b4f2 Check for cmd.com and command.com to check for windows system. 2011-07-06 08:05:32 +02:00
Markus Braun
768dda0d94 Forgot one place while adding '.pgp' suffix. 2011-07-06 08:05:32 +02:00
Markus Braun
bb849bd53e Make gnupg.vim working with cmd under windows. 2011-07-06 08:05:32 +02:00
Markus Braun
d29ae7efa3 Recognize '.pgp' suffix 2011-07-06 08:05:32 +02:00
Markus Braun
8c2d996b57 Default of variable GPGUseAgent to 1
This way so the default behaviour is not changed compared to previous versions.
2011-07-06 08:05:32 +02:00
Markus Braun
d0540c6b48 Information about missing environment GPG_TTY. 2011-07-06 08:05:32 +02:00
Markus Braun
a14b9fe592 Introduced variable GPGUseAgent
Selectively enable usage of gpg-agent.
2011-07-06 08:05:32 +02:00
Markus Braun
167ef9a4f3 GnuPG plugin for Vim
This script implements transparent editing of gpg encrypted files. The
filename must have a ".gpg" 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.
2011-07-06 08:04:37 +02:00