From: Josef Fortier Date: Tue, 4 Sep 2018 22:07:49 +0000 (-0500) Subject: Add support for password obscuring X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/c3b0f3ce059a88721cdc94ea2a4445d2da9f276d?hp=be23735428b792314c72634c32bf3ad791fb7678 Add support for password obscuring --- diff --git a/ftplugin/pass.vim b/ftplugin/pass.vim index 5f26a1a..f728b00 100644 --- a/ftplugin/pass.vim +++ b/ftplugin/pass.vim @@ -35,5 +35,16 @@ endfunction call s:CheckArgsRedact() +function! s:reveal_pass() abort + highlight! link password_store_password Comment +endfunction +command! Reveal call reveal_pass() + +function! s:conceal_pass() abort + highlight! password_store_password guifg=DarkGray guibg=DarkGray ctermfg=8 ctermbg=8 +endfunction +command! Conceal call conceal_pass() +normal GG + " Cleanup at end let &cpoptions = s:save_cpo diff --git a/syntax/pass.vim b/syntax/pass.vim index 5077ff1..8a3c12f 100644 --- a/syntax/pass.vim +++ b/syntax/pass.vim @@ -2,7 +2,7 @@ if exists('b:current_syntax') | finish| endif " first line (by convention always a single pasword syntax match password_store_password /\%1l.*/ -highlight link password_store_password Comment +highlight password_store_password guifg=DarkGray guibg=DarkGray ctermfg=8 ctermbg=8 " colon field value is the suggested path for additional information syntax match password_store_header '\v^[^:]+:'