summaryrefslogtreecommitdiff
path: root/contrib/vim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--contrib/vim/noplaintext.vim46
1 files changed, 46 insertions, 0 deletions
diff --git a/contrib/vim/noplaintext.vim b/contrib/vim/noplaintext.vim
new file mode 100644
index 0000000..9493194
--- /dev/null
+++ b/contrib/vim/noplaintext.vim
@@ -0,0 +1,46 @@
+"
+" Prevent various Vim features from keeping the contents of pass(1) password
+" files (or any other purely temporary files) in plaintext on the system.
+"
+" Either append this to the end of your .vimrc, or install it as a plugin with
+" a plugin manager like Tim Pope's Pathogen.
+"
+" Author: Tom Ryder <tom@sanctum.geek.nz>
+"
+
+" Don't backup files in temp directories or shm
+if exists('&backupskip')
+ set backupskip+=/tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*,*/shm/*
+endif
+
+" Don't keep swap files in temp directories or shm
+if has('autocmd')
+ augroup swapskip
+ autocmd!
+ silent! autocmd BufNewFile,BufReadPre
+ \ /tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*,*/shm/*
+ \ setlocal noswapfile
+ augroup END
+endif
+
+" Don't keep undo files in temp directories or shm
+if has('persistent_undo') && has('autocmd')
+ augroup undoskip
+ autocmd!
+ silent! autocmd BufWritePre
+ \ /tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*,*/shm/*
+ \ setlocal noundofile
+ augroup END
+endif
+
+" Don't keep viminfo for files in temp directories or shm
+if has('viminfo')
+ if has('autocmd')
+ augroup viminfoskip
+ autocmd!
+ silent! autocmd BufNewFile,BufReadPre
+ \ /tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*,*/shm/*
+ \ setlocal viminfo=
+ augroup END
+ endif
+endif
-88/+463 2007-04-07Added Qt-Terminalnecoro4-4/+213 2007-04-06First qt draftnecoro6-1/+796 2007-04-04showed masked packages unmasked by the user similar to stable marked testing ...necoro5-13/+40 2007-03-31changed changelognecoro1-1/+2 2007-03-31Some small changes for etcproposals 1.1necoro1-2/+2 2007-03-31Some small changes for etcproposals 1.1necoro2-3/+3 2007-03-31Some small changes for etcproposals 1.1necoro1-6/+13 2007-03-31Allowed Plugins to have a menunecoro7-201/+315 2007-03-15Added etc-proposals pluginnecoro7-28/+121 2007-03-10Added USE_EXPAND-supportnecoro5-11/+63 2007-03-10Added plugin-data to about-dialognecoro3-197/+264