From b3992cfa5a965548205dd0c2335b49f7738c0380 Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Fri, 11 Sep 2015 10:40:22 +0300 Subject: [PATCH] Add basic support for tup's Tupfile format --- rc/tupfile.kak | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 rc/tupfile.kak diff --git a/rc/tupfile.kak b/rc/tupfile.kak new file mode 100644 index 00000000..a9eafff0 --- /dev/null +++ b/rc/tupfile.kak @@ -0,0 +1,38 @@ +# http://gittup.org/tup/ +# + +# Detection +# ‾‾‾‾‾‾‾‾‾ + +hook global BufCreate (.+/)?[Tt]upfile %{ + set buffer mimetype "" + set buffer filetype tupfile +} + +# Highlighters +# ‾‾‾‾‾‾‾‾‾‾‾‾ + +addhl -group / regions -default code tupfile \ + string '"' (?" 0:value +addhl -group /tupfile/code regex "\$\([\w_]+\)" 0:value +addhl -group /tupfile/code regex ":\s*(foreach)\>" 1:keyword +addhl -group /tupfile/code regex "(\.gitignore\>)" 0:keyword +addhl -group /tupfile/code regex "\" 0:keyword +addhl -group /tupfile/code regex "\<(\&?[\w_]+)\s*[:+]?=" 1:keyword + +# Initialization +# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ + +hook global WinSetOption filetype=tupfile %{ + addhl ref tupfile +} + +hook global WinSetOption filetype=(?!tupfile).* %{ + rmhl tupfile +}