From c3b0f3ce059a88721cdc94ea2a4445d2da9f276d Mon Sep 17 00:00:00 2001 From: Josef Fortier Date: Tue, 4 Sep 2018 17:07:49 -0500 Subject: [PATCH 1/1] Add support for password obscuring --- ftplugin/pass.vim | 11 +++++++++++ syntax/pass.vim | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) 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^[^:]+:' -- 2.39.5