]> git.madduck.net Git - etc/vim.git/blob - syntax/pass.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:

261306905bcb1c128addc9cfa14a48761659aeff
[etc/vim.git] / syntax / pass.vim
1 if exists('b:current_syntax') | finish|  endif
2 if g:password_store_settings.enable_syntax != 'true' | finish | endif
3
4 " set redacted colors from colorscheme
5 let s:error_highlight_str = execute( 'highlight Error' )
6 let s:error_fg = matchstr(s:error_highlight_str, 'guifg=\zs\S*')
7
8 let s:comment_highlight_str = execute( 'highlight Comment' )
9 let s:comment_fg = matchstr(s:comment_highlight_str, 'guifg=\zs\S*')
10
11 " first line (by convention always a single pasword)
12 syntax match password_store_password /\%1l.*/
13 execute 'highlight password_store_password ' .
14             \ ' guibg=' . s:comment_fg .
15             \ ' guifg=' . s:comment_fg .
16             \ ' ctermfg=1 ctermbg=1'
17
18 " highlight short passwords
19 syntax match password_store_password_short /\%1l.\{,6\}$/
20 " highlight password_store_password_short guifg=Red guibg=Red ctermfg=1 ctermbg=1
21 execute 'highlight password_store_password_short ' .
22             \ ' guibg=' . s:error_fg .
23             \ ' guifg=' . s:error_fg .
24             \ ' ctermfg=1 ctermbg=1'
25
26 " colon field value is the suggested path for additional information
27 syntax match password_store_header '\v^[^:]+:'
28 highlight link password_store_header PreProc
29
30