]> git.madduck.net Git - etc/vim.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Initial setup
authorJosef Fortier <fortier@augsburg.edu>
Tue, 4 Sep 2018 20:54:54 +0000 (15:54 -0500)
committerJosef Fortier <fortier@augsburg.edu>
Tue, 4 Sep 2018 20:54:54 +0000 (15:54 -0500)
ftdetect/pass.vim [new file with mode: 0644]
ftplugin/pass.vim [new file with mode: 0644]

diff --git a/ftdetect/pass.vim b/ftdetect/pass.vim
new file mode 100644 (file)
index 0000000..5cb07c1
--- /dev/null
@@ -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 (file)
index 0000000..5f26a1a
--- /dev/null
@@ -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('<afile>: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