aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-06-23 17:33:38 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-06-23 17:33:38 +1200
commit411034679b7129ee74b225191f5d17e6c29d328f (patch)
tree611826877b8dfcdfc2c564b72e6653d724dd369b
parentf2e0766d4f5d02a39ee63b9cf5b1500f95399b33 (diff)
downloaddotfiles-411034679b7129ee74b225191f5d17e6c29d328f.tar.gz
dotfiles-411034679b7129ee74b225191f5d17e6c29d328f.zip
Add password filetype
-rw-r--r--vim/filetype.vim6
-rw-r--r--vim/indent/password.vim11
2 files changed, 17 insertions, 0 deletions
diff --git a/vim/filetype.vim b/vim/filetype.vim
index a4572738..d5c9bdb8 100644
--- a/vim/filetype.vim
+++ b/vim/filetype.vim
@@ -250,6 +250,12 @@ augroup filetypedetect
\,?*.[1-9]
\,*/man[1-9]*/?*.[1-9]*
\ setfiletype nroff
+ " pass(1) password files
+ autocmd BufNewFile,BufRead
+ \ /dev/shm/pass.?*/?*.txt
+ \,$TMPDIR/pass.?*/?*.txt
+ \,/tmp/pass.?*/?*.txt
+ \ setfiletype password
" UNIX password and shadow files
autocmd BufNewFile,BufRead
\ /etc/passwd
diff --git a/vim/indent/password.vim b/vim/indent/password.vim
new file mode 100644
index 00000000..e633fe05
--- /dev/null
+++ b/vim/indent/password.vim
@@ -0,0 +1,11 @@
+" Only do this when not done yet for this buffer
+if exists('b:did_indent')
+ finish
+endif
+let b:did_indent = 1
+
+" Manual indenting and literal tabs
+setlocal noautoindent
+setlocal noexpandtab
+setlocal softtabstop=0
+let b:undo_indent = 'setlocal autoindent< expandtab< softtabstop<'