From 3cb159f0564c084848ffa0cbc6d9abb1ee594291 Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Fri, 8 Sep 2017 14:44:55 +0300 Subject: [PATCH] rc: Add support for Mercurial The script only highlights comments in commit messages, but it's a basis to improve upon if more features are needed in a later time. --- rc/base/mercurial.kak | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 rc/base/mercurial.kak diff --git a/rc/base/mercurial.kak b/rc/base/mercurial.kak new file mode 100644 index 00000000..cd03b011 --- /dev/null +++ b/rc/base/mercurial.kak @@ -0,0 +1,26 @@ +# https://www.mercurial-scm.org/ +# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ + +# Faces +# ‾‾‾‾‾ + +face MercurialCommitComment cyan + +# Detection +# ‾‾‾‾‾‾‾‾‾ + +hook global BufCreate .*hg-editor-\w+\.txt$ %{ + set buffer filetype hg-commit +} + +hook -group hg-commit-highlight global WinSetOption filetype=(?!hg-commit).* %{ + remove-highlighter hg-commit-highlight +} + +# Highlighters +# ‾‾‾‾‾‾‾‾‾‾‾‾ + +hook -group hg-commit-highlight global WinSetOption filetype=hg-commit %{ + add-highlighter group hg-commit-highlight + add-highlighter -group hg-commit-highlight regex '^HG:[^\n]*' 0:MercurialCommitComment +}