diff --git a/autoload/acp.vim b/autoload/acp.vim index 827bbcc..f140cb2 100644 --- a/autoload/acp.vim +++ b/autoload/acp.vim @@ -146,6 +146,13 @@ function acp#meetsForHtmlOmni(context) \ g:acp_behaviorHtmlOmniLength . ',}$' endfunction +" +function acp#meetsForPhpOmni(context) + return g:acp_behaviorPhpOmniLength >= 0 && + \ a:context =~ '\k\{' . + \ g:acp_behaviorPhpOmniLength . ',}$' +endfunction + " function acp#meetsForCssOmni(context) if g:acp_behaviorCssOmniPropertyLength >= 0 && diff --git a/plugin/acp.vim b/plugin/acp.vim index 0c01a31..52e6442 100644 --- a/plugin/acp.vim +++ b/plugin/acp.vim @@ -33,6 +33,7 @@ function s:makeDefaultBehavior() \ 'perl' : [], \ 'xml' : [], \ 'html' : [], + \ 'php' : [], \ 'xhtml' : [], \ 'css' : [], \ } @@ -105,6 +106,12 @@ function s:makeDefaultBehavior() \ 'repeat' : 1, \ }) "--------------------------------------------------------------------------- + call add(behavs.php, { + \ 'command' : "\\", + \ 'meets' : 'acp#meetsForPhpOmni', + \ 'repeat' : 1, + \ }) + "--------------------------------------------------------------------------- call add(behavs.xhtml, { \ 'command' : "\\", \ 'meets' : 'acp#meetsForHtmlOmni', @@ -143,6 +150,7 @@ call s:defineOption('g:acp_behaviorPythonOmniLength', 0) call s:defineOption('g:acp_behaviorPerlOmniLength', -1) call s:defineOption('g:acp_behaviorXmlOmniLength', 0) call s:defineOption('g:acp_behaviorHtmlOmniLength', 0) +call s:defineOption('g:acp_behaviorPhpOmniLength', 2) call s:defineOption('g:acp_behaviorCssOmniPropertyLength', 1) call s:defineOption('g:acp_behaviorCssOmniValueLength', 0) call s:defineOption('g:acp_behavior', {})