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.vim8
1 files changed, 8 insertions, 0 deletions
diff --git a/vim/ftdetect/php.vim b/vim/ftdetect/php.vim
index f28c7ab4..f57ba0e6 100644
--- a/vim/ftdetect/php.vim
+++ b/vim/ftdetect/php.vim
@@ -2,3 +2,11 @@
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