Only disable swapfile, undofile, and viminfo when editing a file.
Signed-off-by: James McCoy <vega.james@gmail.com>
This commit is contained in:
parent
bceace5df6
commit
256810ab64
@ -189,12 +189,22 @@ highlight default link GPGHighlightUnknownRecipient ErrorMsg
|
|||||||
function s:GPGInit(bufread)
|
function s:GPGInit(bufread)
|
||||||
call s:GPGDebug(3, printf(">>>>>>>> Entering s:GPGInit(%d)", a:bufread))
|
call s:GPGDebug(3, printf(">>>>>>>> Entering s:GPGInit(%d)", a:bufread))
|
||||||
|
|
||||||
" we don't want a swap file, as it writes unencrypted data to disk
|
" For FileReadCmd, we're reading the contents into another buffer. If that
|
||||||
setl noswapfile
|
" buffer is also destined to be encrypted, then these settings will have
|
||||||
|
" already been set, otherwise don't set them since it limits the
|
||||||
|
" functionality of the cleartext buffer.
|
||||||
|
if a:bufread
|
||||||
|
" we don't want a swap file, as it writes unencrypted data to disk
|
||||||
|
setl noswapfile
|
||||||
|
|
||||||
" if persistent undo is present, disable it for this buffer
|
" if persistent undo is present, disable it for this buffer
|
||||||
if exists('+undofile')
|
if exists('+undofile')
|
||||||
setl noundofile
|
setl noundofile
|
||||||
|
endif
|
||||||
|
|
||||||
|
" first make sure nothing is written to ~/.viminfo while editing
|
||||||
|
" an encrypted file.
|
||||||
|
set viminfo=
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" the rest only has to be run once
|
" the rest only has to be run once
|
||||||
@ -202,10 +212,6 @@ function s:GPGInit(bufread)
|
|||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" first make sure nothing is written to ~/.viminfo while editing
|
|
||||||
" an encrypted file.
|
|
||||||
set viminfo=
|
|
||||||
|
|
||||||
" check what gpg command to use
|
" check what gpg command to use
|
||||||
if (!exists("g:GPGExecutable"))
|
if (!exists("g:GPGExecutable"))
|
||||||
let g:GPGExecutable = "gpg --trust-model always"
|
let g:GPGExecutable = "gpg --trust-model always"
|
||||||
|
Loading…
Reference in New Issue
Block a user