diff --git a/rc/filetype/erlang.kak b/rc/filetype/erlang.kak new file mode 100644 index 00000000..79a38cef --- /dev/null +++ b/rc/filetype/erlang.kak @@ -0,0 +1,62 @@ +# Erlang/OTP +# https://erlang.org +# ---------------------- + +# Detection and Initialization sections were adapted from rc/filetype/elixir.kak + +# Detection +# ‾‾‾‾‾‾‾‾‾ +hook global BufCreate .*[.](erl|hrl) %{ + set-option buffer filetype erlang +} + +# Initialization +# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +hook global WinSetOption filetype=erlang %{ + require-module erlang + + hook -once -always window WinSetOption filetype=.* %{ remove-hooks window erlang-.+ } +} + +hook -group erlang-highlight global WinSetOption filetype=erlang %{ + add-highlighter window/erlang ref erlang + hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/erlang } +} + +provide-module erlang %[ + +# Highlighters +# ‾‾‾‾‾‾‾‾‾‾‾‾ + +add-highlighter shared/erlang regions +add-highlighter shared/erlang/default default-region group + +add-highlighter shared/erlang/comment region '(?