This is the first commit that brings the privet dotfiles to a public reop previously this was all one puppet module. Now this has been split out so I can put all of the private files in a private puppet module
28 lines
534 B
VimL
28 lines
534 B
VimL
function! s:ScanFile()
|
|
let n = 1
|
|
let nmax = line('$')
|
|
if line('$') > 500
|
|
let nmax = 500
|
|
endif
|
|
while n < nmax
|
|
if getline(n) =~ "^class [A-Z]"
|
|
return 1
|
|
break
|
|
endif
|
|
let n = n + 1
|
|
endwhile
|
|
return 0
|
|
endfunction
|
|
|
|
function! s:DetectPhpClass()
|
|
if match(&filetype, '\v<php.class>') != -1
|
|
return
|
|
endif
|
|
|
|
if s:ScanFile()
|
|
set ft=php.class
|
|
return
|
|
endif
|
|
endfunction
|
|
|
|
"autocmd BufNewFile,BufRead *.php call s:DetectPhpClass()
|