2015-09-11 09:40:22 +02:00
|
|
|
# http://gittup.org/tup/
|
|
|
|
#
|
|
|
|
|
|
|
|
# Detection
|
|
|
|
# ‾‾‾‾‾‾‾‾‾
|
|
|
|
|
|
|
|
hook global BufCreate (.+/)?[Tt]upfile %{
|
|
|
|
set buffer filetype tupfile
|
|
|
|
}
|
|
|
|
|
|
|
|
# Highlighters
|
|
|
|
# ‾‾‾‾‾‾‾‾‾‾‾‾
|
|
|
|
|
2017-01-04 01:07:45 +01:00
|
|
|
add-highlighter -group / regions -default code tupfile \
|
2015-09-11 09:40:22 +02:00
|
|
|
string '"' (?<!\\)(\\\\)*" '' \
|
|
|
|
comment '#' $ ''
|
|
|
|
|
2017-01-04 01:07:45 +01:00
|
|
|
add-highlighter -group /tupfile/string fill string
|
|
|
|
add-highlighter -group /tupfile/comment fill comment
|
2015-09-11 09:40:22 +02:00
|
|
|
|
2017-01-04 01:07:45 +01: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
|
2017-06-29 12:11:39 +02:00
|
|
|
add-highlighter -group /tupfile/code regex "\.gitignore\b" 0:keyword
|
|
|
|
add-highlighter -group /tupfile/code regex "\b(ifn?eq|ifn?def|else|endif|error|include|include_rules|run|preload|export)\b" 0:keyword
|
2017-09-29 04:39:59 +02:00
|
|
|
add-highlighter -group /tupfile/code regex "\b(&?[\w_]+)\s*[:+]?=" 1:keyword
|
2015-09-11 09:40:22 +02:00
|
|
|
|
|
|
|
# Initialization
|
|
|
|
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
|
|
|
|
2017-01-04 01:07:45 +01:00
|
|
|
hook -group tupfile-highlight global WinSetOption filetype=tupfile %{ add-highlighter ref tupfile }
|
|
|
|
hook -group tupfile-highlight global WinSetOption filetype=(?!tupfile).* %{ remove-highlighter tupfile }
|