From: Josef Fortier Date: Tue, 4 Sep 2018 20:54:54 +0000 (-0500) Subject: Initial setup X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/9d788b57245fa78e7779b183f2f90fa00d5c80c1?ds=sidebyside;hp=-c Initial setup --- 9d788b57245fa78e7779b183f2f90fa00d5c80c1 diff --git a/ftdetect/pass.vim b/ftdetect/pass.vim new file mode 100644 index 0000000..5cb07c1 --- /dev/null +++ b/ftdetect/pass.vim @@ -0,0 +1,20 @@ +" detect password-store files +if exists('did_pass') || &compatible || version < 700 + finish +endif +let g:did_pass = 'did_pass' +let s:save_cpo = &cpoptions +set compatible&vim + +" this is straight from Tom Ryders plugin +augroup password-store + autocmd! + autocmd VimEnter + \ /dev/shm/pass.?*/?*.txt + \,$TMPDIR/pass.?*/?*.txt + \,/tmp/pass.?*/?*.txt + \ set filetype=pass +augroup END + +" Cleanup at end +let &cpoptions = s:save_cpo diff --git a/ftplugin/pass.vim b/ftplugin/pass.vim new file mode 100644 index 0000000..5f26a1a --- /dev/null +++ b/ftplugin/pass.vim @@ -0,0 +1,39 @@ +if exists('did_pass_ftplugin') || &compatible || version < 700 + finish +endif +let g:did_pass = 'did_pass_ftplugin' +let s:save_cpo = &cpoptions +set compatible&vim + + +setlocal nospell + + +" Check whether we should set redacting options or not +function! s:CheckArgsRedact() + + " Ensure there's one argument and it's the matched file + if argc() != 1 || fnamemodify(argv(0), ':p') !=# expand(':p') + return + endif + + " Disable all the leaky options globally + set nobackup + set nowritebackup + set noswapfile + set viminfo= + if has('persistent_undo') + set noundofile + endif + + " Tell the user what we're doing so they know this worked, via a message and + " a global variable they can check + echomsg 'Editing password file--disabled leaky options!' + let g:redact_pass_redacted = 1 + +endfunction + +call s:CheckArgsRedact() + +" Cleanup at end +let &cpoptions = s:save_cpo