" Packet filter conf
au BufNewFile,BufRead pf.conf setf pf
+" Pacman Config (close enough to dosini)
+au BufNewFile,BufRead */etc/pacman.conf setf dosini
+
+" Pacman hooks
+au BufNewFile,BufRead *.hook
+ \ if getline(1) == '[Trigger]' |
+ \ setf dosini |
+ \ endif
+
" Pam conf
-au BufNewFile,BufRead */etc/pam.conf setf pamconf
+au BufNewFile,BufRead */etc/pam.conf setf pamconf
" Pam environment
au BufNewFile,BufRead pam_env.conf,.pam_environment setf pamenv
\ 'dnsmasq': ['/etc/dnsmasq.conf'],
\ 'dockerfile': ['Containerfile', 'Dockerfile', 'file.Dockerfile'],
\ 'dosbatch': ['file.bat', 'file.sys'],
- \ 'dosini': ['.editorconfig', '/etc/yum.conf', 'file.ini'],
+ \ 'dosini': ['.editorconfig', '/etc/pacman.conf', '/etc/yum.conf', 'file.ini'],
\ 'dot': ['file.dot', 'file.gv'],
\ 'dracula': ['file.drac', 'file.drc', 'filelvs', 'filelpe'],
\ 'dsl': ['file.dsl'],
close
endfunc
+func Test_hook_file()
+ filetype on
+
+ call writefile(['[Trigger]', 'this is pacman config'], 'Xfile.hook')
+ split Xfile.hook
+ call assert_equal('dosini', &filetype)
+ bwipe!
+
+ call writefile(['not pacman'], 'Xfile.hook')
+ split Xfile.hook
+ call assert_notequal('dosini', &filetype)
+ bwipe!
+
+ call delete('Xfile.hook')
+ filetype off
+endfunc
+
+
" vim: shiftwidth=2 sts=2 expandtab