adding new stuff
This commit is contained in:
parent
f84d7183aa
commit
9ef8a96f9a
1580 changed files with 0 additions and 0 deletions
75
plugins/bundle/xptemplate/ftplugin/php/php.ftdetect.vim
Normal file
75
plugins/bundle/xptemplate/ftplugin/php/php.ftdetect.vim
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
if exists("b:__PHP_FTDETECT_VIM__")
|
||||
finish
|
||||
endif
|
||||
let b:__PHP_FTDETECT_VIM__ = 1
|
||||
|
||||
|
||||
if &filetype !~ 'php'
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
|
||||
let s:skipPattern = 'synIDattr(synID(line("."), col("."), 0), "name") =~? "\\vstring|comment"'
|
||||
let s:pattern = {
|
||||
\ 'php' : {
|
||||
\ 'start' : '\V\c<?\%(php\>\)\?',
|
||||
\ 'mid' : '',
|
||||
\ 'end' : '\V\c?>',
|
||||
\ 'skip' : s:skipPattern,
|
||||
\ },
|
||||
\ 'javascript' : {
|
||||
\ 'start' : '\V\c<script\_[^>]\*>',
|
||||
\ 'mid' : '',
|
||||
\ 'end' : '\V\c</script>',
|
||||
\ 'skip' : s:skipPattern,
|
||||
\ },
|
||||
\ 'css' : {
|
||||
\ 'start' : '\V\c<style\_[^>]\*>',
|
||||
\ 'mid' : '',
|
||||
\ 'end' : '\V\c</style>',
|
||||
\ 'skip' : s:skipPattern,
|
||||
\ },
|
||||
\}
|
||||
|
||||
if exists( 'php_noShortTags' )
|
||||
let s:pattern.php.start = '\V\c<?php\>'
|
||||
endif
|
||||
|
||||
let s:topFT = 'html'
|
||||
|
||||
fun! XPT_phpFiletypeDetect() "{{{
|
||||
let pos = [ line( "." ), col( "." ) ]
|
||||
|
||||
let synName = xpt#util#NearestSynName()
|
||||
|
||||
if synName == ''
|
||||
" top level ft is html
|
||||
return s:topFT
|
||||
|
||||
else
|
||||
|
||||
for [ name, ftPattern ] in items( s:pattern )
|
||||
let pos = searchpairpos( ftPattern.start, ftPattern.mid, ftPattern.end, 'nbW', ftPattern.skip )
|
||||
if pos != [0, 0]
|
||||
return name
|
||||
endif
|
||||
endfor
|
||||
|
||||
if synName =~ '^\cjavascript'
|
||||
return 'javascript'
|
||||
elseif synName =~ '^\ccss'
|
||||
return 'css'
|
||||
endif
|
||||
|
||||
return s:topFT
|
||||
|
||||
endif
|
||||
|
||||
endfunction "}}}
|
||||
|
||||
if exists( 'b:XPTfiletypeDetect' )
|
||||
unlet b:XPTfiletypeDetect
|
||||
endif
|
||||
let b:XPTfiletypeDetect = function( 'XPT_phpFiletypeDetect' )
|
||||
|
||||
81
plugins/bundle/xptemplate/ftplugin/php/php.xpt.vim
Normal file
81
plugins/bundle/xptemplate/ftplugin/php/php.xpt.vim
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
XPTemplate priority=lang
|
||||
|
||||
let s:f = g:XPTfuncs()
|
||||
|
||||
XPTvar $TRUE true
|
||||
XPTvar $FALSE false
|
||||
XPTvar $NULL null
|
||||
XPTvar $UNDEFINED null
|
||||
|
||||
XPTvar $VOID_LINE /* void */;
|
||||
XPTvar $CURSOR_PH /* cursor */
|
||||
|
||||
XPTvar $BRif ' '
|
||||
XPTvar $BRel \n
|
||||
XPTvar $BRloop ' '
|
||||
XPTvar $BRstc ' '
|
||||
XPTvar $BRfun ' '
|
||||
|
||||
XPTinclude
|
||||
\ _common/common
|
||||
|
||||
XPTvar $CL /*
|
||||
XPTvar $CM *
|
||||
XPTvar $CR */
|
||||
XPTinclude
|
||||
\ _comment/doubleSign
|
||||
|
||||
XPTvar $VAR_PRE $
|
||||
XPTvar $FOR_SCOPE
|
||||
XPTinclude
|
||||
\ _loops/for
|
||||
|
||||
XPTinclude
|
||||
\ _condition/c.like
|
||||
\ _loops/c.while.like
|
||||
|
||||
XPTembed
|
||||
\ html/html
|
||||
\ html/php*
|
||||
|
||||
|
||||
|
||||
if exists( 'php_noShortTags' )
|
||||
XPTvar $PHP_TAG php
|
||||
else
|
||||
XPTvar $PHP_TAG
|
||||
endif
|
||||
|
||||
XPT html " <?$PHP_TAG ... ?>
|
||||
?>`html^<?`$PHP_TAG^
|
||||
|
||||
|
||||
XPT foreach " foreach (.. as ..) {..}
|
||||
foreach ($`var^ as `container^)`$BRloop^{
|
||||
`cursor^
|
||||
}
|
||||
|
||||
|
||||
XPT fun " function ..( .. ) {..}
|
||||
XSET params=Void()
|
||||
XSET params|post=EchoIfEq(' ', '')
|
||||
function `funName^(` `params` ^)`$BRfun^{
|
||||
`cursor^
|
||||
}
|
||||
|
||||
|
||||
XPT class " class .. { .. }
|
||||
class `className^`$BRfun^{
|
||||
function __construct( `args^ )`$BRfun^{
|
||||
`cursor^
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XPT interface " interface .. { .. }
|
||||
interface `interfaceName^`$BRfun^{
|
||||
`cursor^
|
||||
}
|
||||
|
||||
XPT $ " make dollar a keyword
|
||||
$
|
||||
Loading…
Add table
Add a link
Reference in a new issue