aboutsummaryrefslogtreecommitdiff
path: root/vim/ftdetect/php.vim
diff options
context:
space:
mode:
Diffstat (limited to 'vim/ftdetect/php.vim')
-rw-r--r--vim/ftdetect/php.vim12
1 files changed, 12 insertions, 0 deletions
diff --git a/vim/ftdetect/php.vim b/vim/ftdetect/php.vim
new file mode 100644
index 00000000..f57ba0e6
--- /dev/null
+++ b/vim/ftdetect/php.vim
@@ -0,0 +1,12 @@
+" PHP files
+autocmd BufNewFile,BufRead
+ \ *.php
+ \ setfiletype php
+autocmd BufNewFile,BufRead
+ \ *
+ \ if getline(1) =~# '\m^#!.\<php\>'
+ \ | setfiletype php
+ \ | endif
+ \ | if getline(1) =~? '\m^<?php\>'
+ \ | setfiletype php
+ \ | endif