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