37
37
" php_sql_nowdoc = 1 for SQL syntax highlighting inside nowdocs (default: 1)
38
38
" b:sql_type_override = 'postgresql' for PostgreSQL syntax highlighting in current buffer (default: 'mysql')
39
39
" g:sql_type_default = 'postgresql' to set global SQL syntax highlighting language default (default: 'mysql')"
40
+ " php_xml_heredoc = 1 for XML syntax highlighting inside heredocs (default: 0)
41
+ " php_xml_nowdoc = 1 for XML syntax highlighting inside nowdocs (default: 0)
40
42
" php_html_in_strings = 1 for HTML syntax highlighting inside strings (default: 0)
41
43
" php_html_in_heredoc = 1 for HTML syntax highlighting inside heredocs (default: 1)
42
44
" php_html_in_nowdoc = 1 for HTML syntax highlighting inside nowdocs (default: 1)
@@ -158,6 +160,21 @@ if ((exists("php_sql_query") && php_sql_query) || (exists("php_sql_heredoc") &&
158
160
endif
159
161
endif
160
162
163
+ if ! exists (" php_xml_heredoc" )
164
+ let php_xml_heredoc= 0
165
+ endif
166
+
167
+ if ! exists (" php_xml_nowdoc" )
168
+ let php_xml_nowdoc= 0
169
+ endif
170
+
171
+ if ((exists (" php_xml_heredoc" ) && php_xml_heredoc) || (exists (" php_xml_nowdoc" ) && php_xml_nowdoc))
172
+ syn include @xmlTop syntax/xml.vim
173
+
174
+ syn sync clear
175
+ unlet ! b: current_syntax
176
+ endif
177
+
161
178
" set default for php_folding so we don't have to keep checking its existence.
162
179
if ! exists (" php_folding" )
163
180
let php_folding = 0
@@ -665,6 +682,9 @@ if version >= 704
665
682
if (exists (" php_sql_heredoc" ) && php_sql_heredoc)
666
683
SynFold syn region phpHereDoc matchgroup= Delimiter start = " \( <<<\)\@ 3<=\z (\(\I\i *\)\=\( sql\)\c\(\i *\)\) $" end = " ^\z 1\( ;\= $\)\@ =" contained contains= @s qlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
667
684
endif
685
+ if (exists (" php_xml_heredoc" ) && php_xml_heredoc)
686
+ SynFold syn region phpHereDoc matchgroup= Delimiter start = " \( <<<\)\@ 3<=\z (\(\I\i *\)\=\( xml\)\c\(\i *\)\) $" end = " ^\z 1\( ;\= $\)\@ =" contained contains= @x mlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
687
+ endif
668
688
" @end phpHereDoc
669
689
else
670
690
" @copy phpHereDoc strip_maximum_size
678
698
if (exists (" php_sql_heredoc" ) && php_sql_heredoc)
679
699
SynFold syn region phpHereDoc matchgroup= Delimiter start = " \( <<<\)\@ <=\z (\(\I\i *\)\=\( sql\)\c\(\i *\)\) $" end = " ^\z 1\( ;\= $\)\@ =" contained contains= @s qlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
680
700
endif
701
+ if (exists (" php_xml_heredoc" ) && php_xml_heredoc)
702
+ SynFold syn region phpHereDoc matchgroup= Delimiter start = " \( <<<\)\@ <=\z (\(\I\i *\)\=\( xml\)\c\(\i *\)\) $" end = " ^\z 1\( ;\= $\)\@ =" contained contains= @x mlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
703
+ endif
681
704
" @end phpHereDoc
682
705
endif
683
706
@@ -693,6 +716,9 @@ if version >= 704
693
716
if (exists (" php_sql_nowdoc" ) && php_sql_nowdoc)
694
717
SynFold syn region phpNowDoc matchgroup= Delimiter start = + \( <<<\)\@ 3 <= ' \z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)' $ + end = " ^\z 1\( ;\= $\)\@ =" contained contains= @s qlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
695
718
endif
719
+ if (exists (" php_xml_nowdoc" ) && php_xml_nowdoc)
720
+ SynFold syn region phpNowDoc matchgroup= Delimiter start = + \( <<<\)\@ 3 <= ' \z(\(\I\i*\)\=\(xml\)\c\(\i*\)\)' $ + end = " ^\z 1\( ;\= $\)\@ =" contained contains= @x mlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
721
+ endif
696
722
" @end phpNowDoc
697
723
else
698
724
" @copy phpHereDoc strip_maximum_size
706
732
if (exists (" php_sql_heredoc" ) && php_sql_heredoc)
707
733
SynFold syn region phpHereDoc matchgroup= Delimiter start = " \( <<<\)\@ <=\z (\(\I\i *\)\=\( sql\)\c\(\i *\)\) $" end = " ^\z 1\( ;\= $\)\@ =" contained contains= @s qlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
708
734
endif
735
+ if (exists (" php_xml_heredoc" ) && php_xml_heredoc)
736
+ SynFold syn region phpHereDoc matchgroup= Delimiter start = " \( <<<\)\@ <=\z (\(\I\i *\)\=\( xml\)\c\(\i *\)\) $" end = " ^\z 1\( ;\= $\)\@ =" contained contains= @x mlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
737
+ endif
709
738
" @end phpNowDoc
710
739
endif
711
740
0 commit comments