diff --git a/rc/filetype/elixir.kak b/rc/filetype/elixir.kak index 9395acb2..8d345309 100644 --- a/rc/filetype/elixir.kak +++ b/rc/filetype/elixir.kak @@ -8,6 +8,10 @@ hook global BufCreate .*[.](ex|exs) %{ set-option buffer filetype elixir } +hook global BufCreate .*[.]html[.]l?eex %{ + set-option buffer filetype eex +} + # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ @@ -25,18 +29,41 @@ hook -group elixir-highlight global WinSetOption filetype=elixir %{ hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/elixir } } +hook global WinSetOption filetype=eex %{ + require-module eex + + hook -once -always window WinSetOption filetype=.* %{ remove-hooks window eex-.+ } +} + +hook -group eex-highlight global WinSetOption filetype=eex %{ + add-highlighter window/eex ref eex + hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/eex } +} + +provide-module eex %{ +require-module html +require-module elixir + +add-highlighter shared/eex regions +add-highlighter shared/eex/html default-region ref html +add-highlighter shared/eex/comment region '<%#' '%>' fill comment +add-highlighter shared/eex/quote region '<%%' '%>' ref html +add-highlighter shared/eex/code region '<%=?' '%>' ref elixir +} provide-module elixir %[ +require-module eex # Highlighters # ‾‾‾‾‾‾‾‾‾‾‾‾ add-highlighter shared/elixir regions add-highlighter shared/elixir/code default-region group -add-highlighter shared/elixir/double_string region '"' (?