From 889499e3e84e37b2272f7a78806690a4249bff52 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 21 Sep 2015 13:37:45 +0100 Subject: [PATCH] Add makefile highlighting support --- rc/makefile.kak | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 rc/makefile.kak diff --git a/rc/makefile.kak b/rc/makefile.kak new file mode 100644 index 00000000..9284aa9d --- /dev/null +++ b/rc/makefile.kak @@ -0,0 +1,30 @@ +# Detection +# ‾‾‾‾‾‾‾‾‾ + +hook global BufSetOption mimetype=text/x-makefile %{ + set buffer filetype makefile +} + +hook global BufCreate [mM]akefile %{ + set buffer filetype makefile +} + +# Highlighters +# ‾‾‾‾‾‾‾‾‾‾‾‾ + +addhl -group / regions -default content makefile \ + comment '#' '$' '' \ + eval '\$\(' '\)' '\(' + +addhl -group /makefile/comment fill comment +addhl -group /makefile/eval fill value + +addhl -group /makefile/content regex ^[\w.%]+\h*:\s 0:identifier +addhl -group /makefile/content regex \b(ifeq|ifneq|else|endif)\b 0:keyword +addhl -group /makefile/content regex [+?:]= 0:operator + +# Initialization +# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ + +hook global WinSetOption filetype=makefile %{ addhl ref makefile } +hook global WinSetOption filetype=(?!makefile).* %{ rmhl makefile }