From a547e731f2dc0d126405859657927e01d4499374 Mon Sep 17 00:00:00 2001 From: Sidharth Kshatriya Date: Sun, 24 Oct 2021 11:39:41 +0530 Subject: [PATCH] Add detection, intialization and basic syntax highlighting for Erlang --- rc/filetype/erlang.kak | 62 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 rc/filetype/erlang.kak 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 '(?