Put in ~/.config/micro/syntax
. Based on 'ini' syntax, modified to highlight templates, arrows =>
and ${interpolated strings}
.
It will highlight all .conf
files, including any non-Asterisk files with that extension.
filetype: asterisk | |
detect: | |
filename: "\\.conf$" | |
rules: | |
- constant.bool.true: "\\btrue\\b" | |
- constant.bool.false: "\\bfalse\\b" | |
- identifier: "^[[:space:]]*[^=]*=" | |
- special: "^[[:space:]]*\\[.*\\]$" | |
- special: "^[[:space:]]*\\[.*\\]\\(.*\\)$" | |
- statement: "[=;]" | |
- statement: "=>" | |
- constant.string: | |
start: "\"" | |
end: "\"" | |
rules: | |
- include: "interpolatedstring" | |
- comment: | |
start: "#" | |
end: "$" | |
rules: | |
- todo: "(TODO|XXX|FIXME):?" | |
- comment: | |
start: ";" | |
end: "$" | |
rules: | |
- todo: "(TODO|XXX|FIXME):?" | |
# '${name}' or '#{name}' | |
- statement: | |
start: "\\${" | |
end: "}" | |
rules: | |
- constant.specialChar: "\\w" |
filetype: interpolatedstring | |
detect: | |
# impossible regexp | |
filename: "\\b\\B" | |
rules: | |
# escaped chars, like '\n' or '\\' | |
- constant.specialChar: "\\\\." | |
# interpolation, like '${name}' or '#{name}' | |
- statement: | |
start: "\\W{" | |
end: "}" | |
rules: | |
- constant.specialChar: "\\w" |