Browse Source

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

François Charlier 6 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.
23 23
 
24 24
 == Simple Vim Password Safe ==
25 25
 
26
-If you edit any file named '.auth.bfa' (that's the full name, not just the
27
-extension) then this plugin will add folding features and an automatic quit
28
-timeout.
26
+If you edit any file named '.auth.aes' or '.auth.bfa' (that's the full name,
27
+not just the extension) then this plugin will add folding features and an
28
+automatic quit timeout.
29 29
 
30 30
 Vim will quit automatically after 5 minutes of no typing activity (unless
31 31
 the file has been changed).
@@ -36,7 +36,7 @@ This plugin will fold on wiki-style headlines in the following format:
36 36
 
37 37
 Any notes under the headline will be inside the fold until the next headline
38 38
 is reached. The SPACE key will toggle a fold open and closed. The q key will
39
-quit Vim. Create the following example file named ~/.auth.des3:
39
+quit Vim. Create the following example file named ~/.auth.aes:
40 40
 
41 41
     == Colo server ==
42 42
 
@@ -48,7 +48,7 @@ quit Vim. Create the following example file named ~/.auth.des3:
48 48
 
49 49
 Then create this bash alias:
50 50
 
51
-    alias auth='view ~/.auth.des3'
51
+    alias auth='view ~/.auth.aes'
52 52
 
53 53
 Now you can view your password safe by typing 'auth'. When Vim starts all
54 54
 the password information will be hidden under the headlines. To view the

+ 25
- 15
plugin/openssl.vim View File

@@ -1,5 +1,15 @@
1 1
 " openssl.vim version 3.3 2008 Noah Spurrier <noah@noah.org>
2 2
 "
3
+" == Changelog
4
+"
5
+" 3.3~fc1
6
+"
7
+"   • simple password safe can be either .auth.aes or .auth.bfa
8
+"
9
+" 3.3
10
+"
11
+"   • change simple password safe from .auth.bfa to .auth.aes
12
+"
3 13
 " == Edit OpenSSL encrypted files and turn Vim into a Password Safe! ==
4 14
 "
5 15
 " This plugin enables reading and writing of files encrypted using OpenSSL.
@@ -23,9 +33,9 @@
23 33
 "
24 34
 " == Simple Vim Password Safe ==
25 35
 "
26
-" If you edit any file named '.auth.aes' (that's the full name, not just the
27
-" extension) then this plugin will add folding features and an automatic quit
28
-" timeout.
36
+" If you edit any file named '.auth.aes' or '.auth.bfa' (that's the full name,
37
+" not just the extension) then this plugin will add folding features and an
38
+" automatic quit timeout.
29 39
 "
30 40
 " Vim will quit automatically after 5 minutes of no typing activity (unless
31 41
 " the file has been changed).
@@ -228,8 +238,8 @@ autocmd BufWritePost,FileWritePost *.des3,*.des,*.bf,*.bfa,*.aes,*.idea,*.cast,*
228 238
 
229 239
 "
230 240
 " The following implements a simple password safe for any file named
231
-" '.auth.aes'. The file is encrypted with AES and base64 ASCII encoded.
232
-" Folding is supported for == headlines == style lines.
241
+" '.auth.aes' or '.auth.bfa'. The file is encrypted with AES and base64 ASCII
242
+" encoded.  Folding is supported for == headlines == style lines.
233 243
 "
234 244
 
235 245
 function! HeadlineDelimiterExpression(lnum)
@@ -238,16 +248,16 @@ function! HeadlineDelimiterExpression(lnum)
238 248
     endif
239 249
     return (getline(a:lnum)=~"^\\s*==.*==\\s*$") ? ">1" : "="
240 250
 endfunction
241
-autocmd BufReadPost,FileReadPost   .auth.aes set foldexpr=HeadlineDelimiterExpression(v:lnum)
242
-autocmd BufReadPost,FileReadPost   .auth.aes set foldlevel=0
243
-autocmd BufReadPost,FileReadPost   .auth.aes set foldcolumn=0
244
-autocmd BufReadPost,FileReadPost   .auth.aes set foldmethod=expr
245
-autocmd BufReadPost,FileReadPost   .auth.aes set foldtext=getline(v:foldstart)
246
-autocmd BufReadPost,FileReadPost   .auth.aes nnoremap <silent><space> :exe 'silent! normal! za'.(foldlevel('.')?'':'l')<CR>
247
-autocmd BufReadPost,FileReadPost   .auth.aes nnoremap <silent>q :q<CR>
248
-autocmd BufReadPost,FileReadPost   .auth.aes highlight Folded ctermbg=red ctermfg=black
249
-autocmd BufReadPost,FileReadPost   .auth.aes set updatetime=300000
250
-autocmd CursorHold                 .auth.aes quit
251
+autocmd BufReadPost,FileReadPost   .auth.{aes,bfa} set foldexpr=HeadlineDelimiterExpression(v:lnum)
252
+autocmd BufReadPost,FileReadPost   .auth.{aes,bfa} set foldlevel=0
253
+autocmd BufReadPost,FileReadPost   .auth.{aes,bfa} set foldcolumn=0
254
+autocmd BufReadPost,FileReadPost   .auth.{aes,bfa} set foldmethod=expr
255
+autocmd BufReadPost,FileReadPost   .auth.{aes,bfa} set foldtext=getline(v:foldstart)
256
+autocmd BufReadPost,FileReadPost   .auth.{aes,bfa} nnoremap <silent><space> :exe 'silent! normal! za'.(foldlevel('.')?'':'l')<CR>
257
+autocmd BufReadPost,FileReadPost   .auth.{aes,bfa} nnoremap <silent>q :q<CR>
258
+autocmd BufReadPost,FileReadPost   .auth.{aes,bfa} highlight Folded ctermbg=red ctermfg=black
259
+autocmd BufReadPost,FileReadPost   .auth.{aes,bfa} set updatetime=300000
260
+autocmd CursorHold                 .auth.{aes,bfa} quit
251 261
 
252 262
 " End of openssl_encrypted
253 263
 augroup END

Loading…
Cancel
Save