1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-11-29 10:02:57 +03:00
kakoune/rc/extra/tupfile.kak

33 lines
1.2 KiB
Plaintext
Raw Normal View History

# http://gittup.org/tup/
#
# Detection
# ‾‾‾‾‾‾‾‾‾
hook global BufCreate (.+/)?[Tt]upfile %{
set buffer filetype tupfile
}
# Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾
2017-01-04 03:07:45 +03:00
add-highlighter -group / regions -default code tupfile \
string '"' (?<!\\)(\\\\)*" '' \
comment '#' $ ''
2017-01-04 03:07:45 +03:00
add-highlighter -group /tupfile/string fill string
add-highlighter -group /tupfile/comment fill comment
2017-01-04 03:07:45 +03:00
add-highlighter -group /tupfile/code regex "\%[fbBeoOdg]\b" 0:value
add-highlighter -group /tupfile/code regex "\$\([\w_]+\)" 0:value
add-highlighter -group /tupfile/code regex ":\s*(foreach)\b" 1:keyword
add-highlighter -group /tupfile/code regex "(\.gitignore\b)" 0:keyword
add-highlighter -group /tupfile/code regex "\bifn?eq|ifn?def|else|endif|error|include|include_rules|run|preload|export\b" 0:keyword
add-highlighter -group /tupfile/code regex "\b(\&?[\w_]+)\s*[:+]?=" 1:keyword
# Initialization
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
2017-01-04 03:07:45 +03:00
hook -group tupfile-highlight global WinSetOption filetype=tupfile %{ add-highlighter ref tupfile }
hook -group tupfile-highlight global WinSetOption filetype=(?!tupfile).* %{ remove-highlighter tupfile }