This repository was archived by the owner on Dec 1, 2020. It is now read-only.
forked from vim-scripts/php.vim--Garvin
-
Notifications
You must be signed in to change notification settings - Fork 69
Flexible heredoc support #89
Labels
Comments
@StanAngeloff Any news here? If you could point to the location that needs to be modified, maybe someone (me?) would find time for a PR. I just never worked on Vim syntax files before so can't promise. |
@mikehaertl I added the following to my personal syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\I\i*\)$" end="^\s*\z1\>" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
syn region phpHereDoc matchgroup=Delimiter start=+\(<<<\)\@3<="\z(\I\i*\)"$+ end="^\s*\z1\>" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
" including HTML,JavaScript,SQL if enabled via options
if (exists("php_html_in_heredoc") && php_html_in_heredoc)
syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@htmlJavascript,phpIdentifierSimply,phpIdentifier,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
endif
if (exists("php_sql_heredoc") && php_sql_heredoc)
syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
endif
if (exists("php_xml_heredoc") && php_xml_heredoc)
syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\(\I\i*\)\=\(xml\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@xmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
endif I never really took the time to PR it into this repo. It is a slightly modified version of this code: Lines 674 to 688 in bbad8f6
|
This is now possible following the merge of #95 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
PHP 7.3 has relaxed the requirements for heredoc/nowdoc end markers (see the corresponding RFC page). Now they allow leading indentation. This plugin, however, doesn't seem to support it yet:

The text was updated successfully, but these errors were encountered: