Add basic support for tup's Tupfile format
This commit is contained in:
parent
fede8da14b
commit
b3992cfa5a
38
rc/tupfile.kak
Normal file
38
rc/tupfile.kak
Normal file
|
@ -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 '"' (?<!\\)(\\\\)*" '' \
|
||||
comment '#' $ ''
|
||||
|
||||
addhl -group /tupfile/string fill string
|
||||
addhl -group /tupfile/comment fill comment
|
||||
|
||||
addhl -group /tupfile/code regex "\%[fbBeoOdg]\>" 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 "\<ifn?eq|ifn?def|else|endif|error|include|include_rules|run|preload|export\>" 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
|
||||
}
|
Loading…
Reference in New Issue
Block a user