diff --git a/rc/filetype/prolog.kak b/rc/filetype/prolog.kak new file mode 100644 index 00000000..fa183c15 --- /dev/null +++ b/rc/filetype/prolog.kak @@ -0,0 +1,49 @@ +# Prolog +# ---------------------- + +# Adapted from rc/filetype/erlang.kak + +# Detection +# ‾‾‾‾‾‾‾‾‾ +hook global BufCreate .*[.](pl|P) %{ + set-option buffer filetype prolog +} + +# Initialization +# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ +hook global WinSetOption filetype=prolog %{ + require-module prolog + + hook -once -always window WinSetOption filetype=.* %{ remove-hooks window prolog-.+ } +} + +hook -group prolog-highlight global WinSetOption filetype=prolog %{ + add-highlighter window/prolog ref prolog + hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/prolog } +} + +provide-module prolog %[ + +# Highlighters +# ‾‾‾‾‾‾‾‾‾‾‾‾ + +add-highlighter shared/prolog regions +add-highlighter shared/prolog/default default-region group + +add-highlighter shared/prolog/comment region '(?