]> git.madduck.net Git - etc/vim.git/blobdiff - .vim/bundle/password-store/syntax/obfuscated.vim

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit '3e3c8f18c7e13b80a0657d48c3c4fa8f55d9eb68'
[etc/vim.git] / .vim / bundle / password-store / syntax / obfuscated.vim
index 0a53ea8574d90934a0635b540aa6ecb9db22b48c..8eff972a97844de7d43b36b812e5631000548da4 100644 (file)
@@ -1,21 +1,31 @@
 if exists('b:current_syntax') | finish|  endif
 
+if execute('highlight CursorLine') =~# 'xxx term=underline cterm=underline guibg=Grey40'
+    echohl WarningMsg
+    echo 'cursorline expected for obfuscation, manually setting'
+    echohl None
+    highlight CursorLine term=underline ctermbg=gray guibg=Grey40
+endif
+
 setlocal cursorline
 
 " set redacted colors from colorscheme
-let s:error_highlight_str = execute( 'highlight Error' )
-let s:error_fg = matchstr(s:error_highlight_str, 'guifg=\zs\S*')
+" regular passwords are Comment
+let s:comment_guifg = password_store#get_highight('Comment', 'guifg')
+let s:comment_ctermfg = password_store#get_highight('Comment', 'ctermfg')
 
-let s:comment_highlight_str = execute( 'highlight Comment' )
-let s:comment_fg = matchstr(s:comment_highlight_str, 'guifg=\zs\S*')
+" short passwords are Error
+let s:error_guifg = password_store#get_highight('Error', 'guifg')
+let s:error_ctermfg = password_store#get_highight('Error', 'ctermfg')
 
 execute 'highlight password_store_password ' .
-            \ ' guibg=' . s:comment_fg .
-            \ ' guifg=' . s:comment_fg .
-            \ ' ctermfg=1 ctermbg=1'
+            \ ' guibg=' . s:comment_guifg .
+            \ ' guifg=' . s:comment_guifg .
+            \ ' ctermfg=' . s:comment_ctermfg
+            \  'ctermbg=' . s:comment_ctermfg
 
 execute 'highlight password_store_password_short ' .
-            \ ' guibg=' . s:error_fg .
-            \ ' guifg=' . s:error_fg .
-            \ ' ctermfg=1 ctermbg=1'
-
+            \ ' guibg=' . s:error_guifg .
+            \ ' guifg=' . s:error_guifg .
+            \ ' ctermfg=' . s:error_ctermfg
+            \  'ctermbg=' . s:error_ctermfg