hide crypted text

This commit is contained in:
Ville Rantanen
2017-02-10 12:25:36 +02:00
parent 690d565fae
commit 7b33fd218b
2 changed files with 22 additions and 2 deletions

20
vim/crypted.vim Normal file
View File

@@ -0,0 +1,20 @@
set cursorline
"hi CursorLine ctermbg=Black ctermfg=White
"hi Normal ctermbg=Black ctermfg=Black
function! Hide ()
hi CursorLine ctermbg=NONE ctermfg=White
hi Normal ctermbg=Black ctermfg=Black
endfunction
function! Nohide ()
hi CursorLine ctermbg=NONE ctermfg=White
hi Normal ctermbg=NONE ctermfg=Gray
endfunction
map h :<C-U>call Hide()<CR>
map H :<C-U>call Nohide()<CR>
set laststatus=2
set statusline=%f\ %=\ (h/H)\ (%v,%l)
call Nohide()

View File

@@ -37,10 +37,10 @@ then echo "File $1 does not exist. Creating empty file"
else else
gpg --decrypt "$1" > "$unc" gpg --decrypt "$1" > "$unc"
fi fi
LIB=$( dirname $( readlink -f $0 ) )/crypted.vim
edit=`date +%s -r $unc` edit=`date +%s -r $unc`
if [ -s "$unc" ] if [ -s "$unc" ]
then vim -i NONE -n "$unc" then vim -i NONE -S "$LIB" -n "$unc"
else echo Error in decrypting else echo Error in decrypting
$RM "$unc" $RM "$unc"
exit 1 exit 1