# 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 '(? add-highlighter shared/erlang/default/ref regex '#Ref<\d+\.\d+\.\d+\.\d+>' 0:value # e.g. #Port<0.1> add-highlighter shared/erlang/default/port regex '#Port<\d+\.\d+>' 0:value # e.g. <0.401.0> add-highlighter shared/erlang/default/pid regex '<\d+\.\d+\.\d+>' 0:value add-highlighter shared/erlang/default/base_number regex '\b(\d[_\d]*(?