X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/d6c1a4935fbd3f1f1a37f442693b84b78bdc8575..13b978df5a5f0f9a79a8352c7989c59108d35c29:/ftplugin/pass.vim diff --git a/ftplugin/pass.vim b/ftplugin/pass.vim index 66b91c7..c6a2680 100644 --- a/ftplugin/pass.vim +++ b/ftplugin/pass.vim @@ -5,26 +5,6 @@ let g:did_pass = 'did_pass_ftplugin' let s:save_cpo = &cpoptions set compatible&vim - -let s:default_settings = { - \ 'pw_length' : '12', - \ 'enable_syntax' : 'true', - \ } - -if ! exists('g:password_store_settings') - let g:password_store_settings = {} -endif - -for s:setting in keys(s:default_settings) - if ! has_key( g:password_store_settings, s:setting ) - let g:password_store_settings[s:setting] = s:default_settings[s:setting] - endif -endfor - -if ! exists('g:password_store_pw_length') - let g:password_store_pw_length = 12 -endif - nmap rotate_password :call password_store#replace() if ! hasmapto( '\rotate_password', 'n') nmap rotate_password @@ -70,5 +50,9 @@ 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