1 ## Syntax highlighting for Hashicorp Terraform / HCL files.
3 # See: https://github.com/hashicorp/hcl
4 # Original author: John Boero
5 # License: GPLv3 or newer
7 syntax hcl "\.(tf|hcl)$"
8 # No comments are permitted in JSON.
11 # Numbers (used as value).
12 color green ":[[:space:]]*\-?(0|[1-9][0-9]*)(\.[0-9]+)?([Ee]?[-+]?[0-9]+)?"
13 # Values (well, any string).
14 color brightmagenta "\".+\""
15 # Hex numbers (used as value).
16 color green ":[[:space:]]*\"#[0-9abcdefABCDEF]+\""
18 color green "\\\\" "\\\"" "\\[bfnrt]" "\\u[0-9abcdefABCDEF]{4})"
20 color green "(true|false|null|output|path|vault|description|default|value)"
22 color brightgreen "(variable|terraform|resource|provider|module)"
24 # Names (very unlikely to contain a quote).
25 color brightblue "\"[^"]+\"[[:space:]]*:"
27 # Brackets, braces, and separators.
28 color brightblue "\[" "\]"
29 color brightred "\{" "\}"
30 color brightred "," ":"
33 color cyan "(^|[[:space:]]+)(//|#).*$"
35 # Trailing whitespace.
36 color ,green "[[:space:]]+$"