aboutsummaryrefslogtreecommitdiff
path: root/vim/ftplugin/php.vim
blob: 35292e156b53b7e588abe7ba3e8a9ca8508c53ae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"
" Replace Vim's stock PHP filetype plugin, reimplementing only the part I
" actually need: the matchit.vim keyword pairs.
"
" This is mostly because the stock file pulls in HTML's filetype plugins too,
" without providing a variable check to stop it. That causes absurd problems
" with defining HTML checkers/linters in the rest of my files.
"
if exists('b:did_ftplugin') || &compatible
  finish
endif
let b:did_ftplugin = 1

" Define keywords for matchit.vim
if exists('g:loaded_matchit')
  let b:match_words = '<?php:?>'
        \ . ',\<do\>:\<while\>'
        \ . ',\<for\>:\<endfor\>'
        \ . ',\<foreach\>:\<endforeach\>'
        \ . ',\<if\>:\<elseif\>:\<else\>:\<endif\>'
        \ . ',\<switch\>:\<endswitch\>'
        \ . ',\<while\>:\<endwhile\>'
endif

" Define how to undo this plugin's settings
let b:undo_ftplugin = 'unlet b:match_words'