Closed mortenbh closed 9 years ago
'nobackup'
is Vim's default value. Are you saying that you set 'backup'
in your ~/.vimrc and something is causing it to switch to 'nobackup'
when you edit an encrypted file?
Sorry for not being clear. Initially I was worried that since I have backup
set in my vimrc that potentially vim-gnupg would leave an unencrypted backup file behind (this was happening when I was using ZX2C4's pass). When checking the source of vim-gnupg, I couldn't find any place that set nobackup
. I don't know if this is intended, but I thought maybe it should, since viminfo
swapfile
and undofile
are all disabled. After some deliberation I concluded that leaving behind a backup is not really bad as long as it's encrypted. Regardless of my own expectation, however, I noticed that vim-gnupg actually does not leave behind backup files irrespective of the status of backup
. Glancing quickly over the source code, I couldn't immediately tell what is causing this. Could you clarify?
Ah, this is likely due to the plugin using the BufWriteCmd
autocmd, so it performs the entire process of writing to disk, rather than letting Vim handle it.
The plugin writes the encrypted file to a temporary location and, if that was successful, then renames it over the original file.
Hi,
I love you plugin. :) I just have one question, which I hope you can clarify. As far as I can tell from the source code and by checking 'set backup?', writing of backup files is not explicitly disabled by this plugin (unlike swap files, undo files and viminfo). On the other hand, when I edit a .gpg or .asc file, no backup seems to be created. I couldn't figure out what causes backup files not to be written, since 'nobackup' is not explicitly set by this plugin. Can you explain why no backup is created?
In my case, I would actually like to set nobackup, which I realize I could with an autocmd. Perhaps some people would like backups (as long as the backed up copy remains encrypted). Presently, this does not seem possible or, at least, it is not obvious to me how to do it.