jamessan / vim-gnupg

This script implements transparent editing of gpg encrypted files.
http://www.vim.org/scripts/script.php?script_id=3645
729 stars 73 forks source link

Added a newline after the scratch buffer comment #74

Closed czocher closed 7 years ago

czocher commented 7 years ago

Hi, First of all thanks for your hard work @jamessan this vim plugin is not only very useful but also awesome.

As for the change I propose, it's a very simple one. As I was using vim I constantly clicked "i" to edit the recipient scratch buffer, then of course I had to press ESC and "o" to create a newline after the scratch comment and then insert my recipients. This commit adds an empty line after the comment so the cursor starts in an empty line and allows you to start editing either by clicking "i" or "o".

There may be a further improvement to start the scratch buffer in insert mode.

jamessan commented 7 years ago

Thanks for the contribution!

This commit adds an empty line after the comment so the cursor starts in an empty line

If there are already recipients for the file, then the blank line will be between the existing recipients and the header comment, so the cursor doesn't end up there.

If this blank line were only added when there are no recipients added to the buffer (i.e., when the number of lines in the buffer == the number of header lines), then I think it would be a reasonable change. I don't think it's necessary when recipients have already been defined, since that is assuming the user wants to add recipients, not edit them.