1
0
Fork 0

V3.3~fc1 Password safe as .auth.aes or .auth.bfa

master
François Charlier 11 years ago
parent d4035e23df
commit 07cad7a731

@ -23,9 +23,9 @@ password.
== Simple Vim Password Safe == == Simple Vim Password Safe ==
If you edit any file named '.auth.bfa' (that's the full name, not just the If you edit any file named '.auth.aes' or '.auth.bfa' (that's the full name,
extension) then this plugin will add folding features and an automatic quit not just the extension) then this plugin will add folding features and an
timeout. automatic quit timeout.
Vim will quit automatically after 5 minutes of no typing activity (unless Vim will quit automatically after 5 minutes of no typing activity (unless
the file has been changed). the file has been changed).
@ -36,7 +36,7 @@ This plugin will fold on wiki-style headlines in the following format:
Any notes under the headline will be inside the fold until the next headline Any notes under the headline will be inside the fold until the next headline
is reached. The SPACE key will toggle a fold open and closed. The q key will is reached. The SPACE key will toggle a fold open and closed. The q key will
quit Vim. Create the following example file named ~/.auth.des3: quit Vim. Create the following example file named ~/.auth.aes:
== Colo server == == Colo server ==
@ -48,7 +48,7 @@ quit Vim. Create the following example file named ~/.auth.des3:
Then create this bash alias: Then create this bash alias:
alias auth='view ~/.auth.des3' alias auth='view ~/.auth.aes'
Now you can view your password safe by typing 'auth'. When Vim starts all Now you can view your password safe by typing 'auth'. When Vim starts all
the password information will be hidden under the headlines. To view the the password information will be hidden under the headlines. To view the

@ -1,5 +1,15 @@
" openssl.vim version 3.3 2008 Noah Spurrier <noah@noah.org> " openssl.vim version 3.3 2008 Noah Spurrier <noah@noah.org>
" "
" == Changelog
"
" 3.3~fc1
"
" • simple password safe can be either .auth.aes or .auth.bfa
"
" 3.3
"
" • change simple password safe from .auth.bfa to .auth.aes
"
" == Edit OpenSSL encrypted files and turn Vim into a Password Safe! == " == Edit OpenSSL encrypted files and turn Vim into a Password Safe! ==
" "
" This plugin enables reading and writing of files encrypted using OpenSSL. " This plugin enables reading and writing of files encrypted using OpenSSL.
@ -23,9 +33,9 @@
" "
" == Simple Vim Password Safe == " == Simple Vim Password Safe ==
" "
" If you edit any file named '.auth.aes' (that's the full name, not just the " If you edit any file named '.auth.aes' or '.auth.bfa' (that's the full name,
" extension) then this plugin will add folding features and an automatic quit " not just the extension) then this plugin will add folding features and an
" timeout. " automatic quit timeout.
" "
" Vim will quit automatically after 5 minutes of no typing activity (unless " Vim will quit automatically after 5 minutes of no typing activity (unless
" the file has been changed). " the file has been changed).
@ -228,8 +238,8 @@ autocmd BufWritePost,FileWritePost *.des3,*.des,*.bf,*.bfa,*.aes,*.idea,*.cast,*
" "
" The following implements a simple password safe for any file named " The following implements a simple password safe for any file named
" '.auth.aes'. The file is encrypted with AES and base64 ASCII encoded. " '.auth.aes' or '.auth.bfa'. The file is encrypted with AES and base64 ASCII
" Folding is supported for == headlines == style lines. " encoded. Folding is supported for == headlines == style lines.
" "
function! HeadlineDelimiterExpression(lnum) function! HeadlineDelimiterExpression(lnum)
@ -238,16 +248,16 @@ function! HeadlineDelimiterExpression(lnum)
endif endif
return (getline(a:lnum)=~"^\\s*==.*==\\s*$") ? ">1" : "=" return (getline(a:lnum)=~"^\\s*==.*==\\s*$") ? ">1" : "="
endfunction endfunction
autocmd BufReadPost,FileReadPost .auth.aes set foldexpr=HeadlineDelimiterExpression(v:lnum) autocmd BufReadPost,FileReadPost .auth.{aes,bfa} set foldexpr=HeadlineDelimiterExpression(v:lnum)
autocmd BufReadPost,FileReadPost .auth.aes set foldlevel=0 autocmd BufReadPost,FileReadPost .auth.{aes,bfa} set foldlevel=0
autocmd BufReadPost,FileReadPost .auth.aes set foldcolumn=0 autocmd BufReadPost,FileReadPost .auth.{aes,bfa} set foldcolumn=0
autocmd BufReadPost,FileReadPost .auth.aes set foldmethod=expr autocmd BufReadPost,FileReadPost .auth.{aes,bfa} set foldmethod=expr
autocmd BufReadPost,FileReadPost .auth.aes set foldtext=getline(v:foldstart) autocmd BufReadPost,FileReadPost .auth.{aes,bfa} set foldtext=getline(v:foldstart)
autocmd BufReadPost,FileReadPost .auth.aes nnoremap <silent><space> :exe 'silent! normal! za'.(foldlevel('.')?'':'l')<CR> autocmd BufReadPost,FileReadPost .auth.{aes,bfa} nnoremap <silent><space> :exe 'silent! normal! za'.(foldlevel('.')?'':'l')<CR>
autocmd BufReadPost,FileReadPost .auth.aes nnoremap <silent>q :q<CR> autocmd BufReadPost,FileReadPost .auth.{aes,bfa} nnoremap <silent>q :q<CR>
autocmd BufReadPost,FileReadPost .auth.aes highlight Folded ctermbg=red ctermfg=black autocmd BufReadPost,FileReadPost .auth.{aes,bfa} highlight Folded ctermbg=red ctermfg=black
autocmd BufReadPost,FileReadPost .auth.aes set updatetime=300000 autocmd BufReadPost,FileReadPost .auth.{aes,bfa} set updatetime=300000
autocmd CursorHold .auth.aes quit autocmd CursorHold .auth.{aes,bfa} quit
" End of openssl_encrypted " End of openssl_encrypted
augroup END augroup END

Loading…
Cancel
Save