@@ -109,16 +109,42 @@ syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\l\/"
109109syn region elixirSigil matchgroup =elixirSigilDelimiter start =+ \~\a\z ("""\) + end =+ ^\s *\z 1+ skip =+ \\ "+ fold
110110syn region elixirSigil matchgroup =elixirSigilDelimiter start =+ \~\a\z ('''\) + end =+ ^\s *\z 1+ skip =+ \\ '+ fold
111111
112-
113- " LiveView Sigils surrounded with ~L"""
112+ " LiveView-specific sigils for embedded templates
114113syntax include @HTML syntax/html.vim
115114unlet b: current_syntax
116- syntax region elixirLiveViewSigil matchgroup =elixirSigilDelimiter keepend start =+ \~ L\z ("""\) + end =+ ^\s *\z 1+ skip =+ \\ "+ contains =@HTML fold
117- syntax region elixirSurfaceSigil matchgroup =elixirSigilDelimiter keepend start =+ \~ H\z ("""\) + end =+ ^\s *\z 1+ skip =+ \\ "+ contains =@HTML fold
115+ syntax region elixirHeexSigil matchgroup =elixirSigilDelimiter keepend start =+ \~ H\z ("""\) + end =+ ^\s *\z 1+ skip =+ \\ "+ contains =@HTML fold
118116syntax region elixirSurfaceSigil matchgroup =elixirSigilDelimiter keepend start =+ \~ F\z ("""\) + end =+ ^\s *\z 1+ skip =+ \\ "+ contains =@HTML fold
117+ syntax region elixirLiveViewSigil matchgroup =elixirSigilDelimiter keepend start =+ \~ L\z ("""\) + end =+ ^\s *\z 1+ skip =+ \\ "+ contains =@HTML fold
119118syntax region elixirPhoenixESigil matchgroup =elixirSigilDelimiter keepend start =+ \~ E\z ("""\) + end =+ ^\s *\z 1+ skip =+ \\ "+ contains =@HTML fold
120119syntax region elixirPhoenixeSigil matchgroup =elixirSigilDelimiter keepend start =+ \~ e\z ("""\) + end =+ ^\s *\z 1+ skip =+ \\ "+ contains =@HTML fold
121120
121+ syn cluster elixirTemplateSigils contains =elixirLiveViewSigil,elixirHeexSigil,elixirSurfaceSigil,elixirPhoenixESigil,elixirPhoenixeSigil
122+
123+ syn region heexComponent matchgroup =eelixirDelimiter start =" <\. [a-z_]\+ " end =" %\@ <!>" contains =ALLBUT,@elixirNotTop keepend
124+ syn region eelixirExpression matchgroup =eelixirDelimiter start =" <%" end =" %\@ <!%>" contains =ALLBUT,@elixirNotTop containedin =@elixirTemplateSigils keepend
125+ syn region eelixirExpression matchgroup =eelixirDelimiter start =" <%=" end =" %\@ <!%>" contains =ALLBUT,@elixirNotTop containedin =@elixirTemplateSigils keepend
126+ syn region eelixirQuote matchgroup =eelixirDelimiter start =" <%%" end =" %\@ <!%>" contains =ALLBUT,@elixirNotTop containedin =@elixirTemplateSigils keepend
127+ syn region heexComment matchgroup =eelixirDelimiter start =" <%!--" end =" %\@ <!--%>" contains =elixirTodo,eelixirComment,@Spell containedin =@elixirTemplateSigils keepend
128+ syn region heexExpression matchgroup =heexDelimiter start =" =\z s{" end =" }" contains =ALLBUT,@elixirNotTop containedin =htmlValue keepend
129+ syn region heexExpression matchgroup =heexDelimiter start =" =\z s{" end =" }" skip =" #{[^}]*}" contains =ALLBUT,@elixirNotTop containedin =htmlValue keepend
130+ " missing `keepend` on next line is intentional
131+ syn region heexExpression matchgroup =heexDelimiter start =" =\z s{" end =" }" skip =" %{[^}]*}" contains =ALLBUT,@elixirNotTop containedin =htmlValue
132+
133+ syn match phxArg " \< phx[-.0-9_a-z]*-[-.0-9_a-z]*\> " containedin =htmlTag
134+ syn match heexArg " \< [0-9_a-z]*\>\z e=" containedin =htmlTag
135+ syn match heexSpecialAttribute " :\% (if\| for\| let\)\z e=" containedin =htmlTag
136+ syn match heexComponentName " <\z s\. [A-Z_a-z][A-Z_a-z0-9]\+ " containedin =htmlTag
137+ syn match heexEndComponent " <\z s\/\. [A-Z_a-z][A-Z_a-z0-9]\+ " containedin =htmlEndTag
138+
139+ hi def link eelixirDelimiter PreProc
140+ hi def link heexDelimiter PreProc
141+ hi def link heexComment Comment
142+ hi def link phxArg htmlArg
143+ hi def link heexArg htmlArg
144+ hi def link heexSpecialAttribute htmlArg
145+ hi def link heexComponentName htmlTagName
146+ hi def link heexEndComponent htmlTagName
147+
122148" Documentation
123149if exists (' g:elixir_use_markdown_for_docs' ) && g: elixir_use_markdown_for_docs
124150 syn include @markdown syntax/markdown.vim
0 commit comments