Browse Source

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

master
François Charlier 7 years ago
parent
commit
07cad7a731
2 changed files with 30 additions and 20 deletions
  1. +5
    -5
      README
  2. +25
    -15
      plugin/openssl.vim

+ 5
- 5
README View File

@@ -23,9 +23,9 @@ password.

== Simple Vim Password Safe ==

If you edit any file named '.auth.bfa' (that's the full name, not just the
extension) then this plugin will add folding features and an automatic quit
timeout.
If you edit any file named '.auth.aes' or '.auth.bfa' (that's the full name,
not just the extension) then this plugin will add folding features and an
automatic quit timeout.

Vim will quit automatically after 5 minutes of no typing activity (unless
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
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 ==

@@ -48,7 +48,7 @@ quit Vim. Create the following example file named ~/.auth.des3:

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
the password information will be hidden under the headlines. To view the


+ 25
- 15
plugin/openssl.vim View File

@@ -1,5 +1,15 @@
" 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! ==
"
" This plugin enables reading and writing of files encrypted using OpenSSL.
@@ -23,9 +33,9 @@
"
" == Simple Vim Password Safe ==
"
" If you edit any file named '.auth.aes' (that's the full name, not just the
" extension) then this plugin will add folding features and an automatic quit
" timeout.
" If you edit any file named '.auth.aes' or '.auth.bfa' (that's the full name,
" not just the extension) then this plugin will add folding features and an
" automatic quit timeout.
"
" Vim will quit automatically after 5 minutes of no typing activity (unless
" 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
" '.auth.aes'. The file is encrypted with AES and base64 ASCII encoded.
" Folding is supported for == headlines == style lines.
" '.auth.aes' or '.auth.bfa'. The file is encrypted with AES and base64 ASCII
" encoded. Folding is supported for == headlines == style lines.
"

function! HeadlineDelimiterExpression(lnum)
@@ -238,16 +248,16 @@ function! HeadlineDelimiterExpression(lnum)
endif
return (getline(a:lnum)=~"^\\s*==.*==\\s*$") ? ">1" : "="
endfunction
autocmd BufReadPost,FileReadPost .auth.aes set foldexpr=HeadlineDelimiterExpression(v:lnum)
autocmd BufReadPost,FileReadPost .auth.aes set foldlevel=0
autocmd BufReadPost,FileReadPost .auth.aes set foldcolumn=0
autocmd BufReadPost,FileReadPost .auth.aes set foldmethod=expr
autocmd BufReadPost,FileReadPost .auth.aes 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 nnoremap <silent>q :q<CR>
autocmd BufReadPost,FileReadPost .auth.aes highlight Folded ctermbg=red ctermfg=black
autocmd BufReadPost,FileReadPost .auth.aes set updatetime=300000
autocmd CursorHold .auth.aes quit
autocmd BufReadPost,FileReadPost .auth.{aes,bfa} set foldexpr=HeadlineDelimiterExpression(v:lnum)
autocmd BufReadPost,FileReadPost .auth.{aes,bfa} set foldlevel=0
autocmd BufReadPost,FileReadPost .auth.{aes,bfa} set foldcolumn=0
autocmd BufReadPost,FileReadPost .auth.{aes,bfa} set foldmethod=expr
autocmd BufReadPost,FileReadPost .auth.{aes,bfa} set foldtext=getline(v:foldstart)
autocmd BufReadPost,FileReadPost .auth.{aes,bfa} nnoremap <silent><space> :exe 'silent! normal! za'.(foldlevel('.')?'':'l')<CR>
autocmd BufReadPost,FileReadPost .auth.{aes,bfa} nnoremap <silent>q :q<CR>
autocmd BufReadPost,FileReadPost .auth.{aes,bfa} highlight Folded ctermbg=red ctermfg=black
autocmd BufReadPost,FileReadPost .auth.{aes,bfa} set updatetime=300000
autocmd CursorHold .auth.{aes,bfa} quit

" End of openssl_encrypted
augroup END


Loading…
Cancel
Save