X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/9d788b57245fa78e7779b183f2f90fa00d5c80c1..329e21ac77e347520634119b979cf02f26988491:/ftplugin/pass.vim?ds=inline diff --git a/ftplugin/pass.vim b/ftplugin/pass.vim index 5f26a1a..c6a2680 100644 --- a/ftplugin/pass.vim +++ b/ftplugin/pass.vim @@ -1,10 +1,14 @@ -if exists('did_pass_ftplugin') || &compatible || version < 700 +if exists('did_pass_ftplugin') || &compatible || v:version < 700 finish endif let g:did_pass = 'did_pass_ftplugin' let s:save_cpo = &cpoptions set compatible&vim +nmap rotate_password :call password_store#replace() +if ! hasmapto( '\rotate_password', 'n') + nmap rotate_password +endif setlocal nospell @@ -35,5 +39,20 @@ 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 + +augroup password_settings_late_load + autocmd! + autocmd FileReadPost if &filetype == 'pass' | echom 'autocmd triggered' | let b:load_pass_syntax = 1 | source 'syntax/pass.vim' | endif +augroup end " Cleanup at end let &cpoptions = s:save_cpo