2015-09-11 09:40:22 +02:00
|
|
|
# http://gittup.org/tup/
|
|
|
|
#
|
|
|
|
|
|
|
|
# Detection
|
|
|
|
# ‾‾‾‾‾‾‾‾‾
|
|
|
|
|
2017-11-04 07:39:23 +01:00
|
|
|
hook global BufCreate .*/?Tup(file|rules)(\.\w+)?$ %{
|
2017-11-03 08:34:41 +01:00
|
|
|
set-option buffer filetype tupfile
|
2015-09-11 09:40:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# Highlighters
|
|
|
|
# ‾‾‾‾‾‾‾‾‾‾‾‾
|
|
|
|
|
2018-07-01 11:53:35 +02:00
|
|
|
add-highlighter shared/tupfile regions
|
|
|
|
add-highlighter shared/tupfile/code default-region group
|
2018-07-02 12:59:12 +02:00
|
|
|
add-highlighter shared/tupfile/string region '"' (?<!\\)(\\\\)*" fill string
|
|
|
|
add-highlighter shared/tupfile/comment region '#' $ fill comment
|
2018-07-01 11:53:35 +02:00
|
|
|
|
|
|
|
add-highlighter shared/tupfile/code/ regex '%[fbBeoOdg]\b' 0:value
|
|
|
|
add-highlighter shared/tupfile/code/ regex '[$@]\([\w_]+\)' 0:value
|
|
|
|
add-highlighter shared/tupfile/code/ regex '^\h*:\s*(foreach)\b' 1:keyword
|
|
|
|
add-highlighter shared/tupfile/code/ regex '^\h*(\.gitignore)\b' 1:keyword
|
|
|
|
add-highlighter shared/tupfile/code/ regex '^\h*\b(ifn?eq|ifn?def|else|endif|error|include|include_rules|run|preload|export)\b' 0:keyword
|
|
|
|
add-highlighter shared/tupfile/code/ regex '^\h*\b(&?[\w_]+)\s*[:+]?=' 1:keyword
|
|
|
|
add-highlighter shared/tupfile/code/ regex '`[^`\n]+`' 0:meta
|
2015-09-11 09:40:22 +02:00
|
|
|
|
|
|
|
# Initialization
|
|
|
|
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
|
|
|
|
2018-11-28 10:39:18 +01:00
|
|
|
hook -group tupfile-highlight global WinSetOption filetype=tupfile %{
|
|
|
|
add-highlighter window/tupfile ref tupfile
|
|
|
|
hook -once -always window WinSetOption filetype=(?!tupfile).* %{ remove-highlighter window/tupfile }
|
|
|
|
}
|