dotfiles-pub/common/nano/syntax/c.nanorc

48 lines
2.0 KiB
Plaintext

syntax "c" "\.(c(c|pp|xx)?|C)$" "\.(h(h|pp|xx)?|H)$" "\.ii?$"
# Resets everything back to plain text coloring.
# Can be used at the start of each theme file.
color white "^.*$"
color cyan "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]"
color white "[(]"
color red "\<[A-Z_][0-9A-Z_]+\>"
color blue "\<(float|double|bool|char|int|short|long|void|(un)?signed)\>"
color blue "\<[a-z0-9_]+_t\>"
color red "\<(struct|enum|static|const|union|typedef|extern)\>"
color red "\<(for|if|while|do|else|case|default|switch)\>"
color red "\<(return|inline|sizeof|auto|register|volatile|restrict)\>"
color red "\<(try|throw|catch|operator|new|delete)\>"
color red "\<(goto|break|continue)\>"
color brightwhite "\<(true|false)\>"
color yellow "[-+/*=<>?:!~%&|^]"
color brightwhite "\<([0-9]+|0x[0-9a-fA-F]*)\>|'.'"
color red "^[[:space:]]*#[[:space:]]*(define|include(_next)?|(un|ifn?)def|endif|el(if|se)|if|warning|error|pragma)"
color red "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
color green ""(\\.|[^"])*"|<[A-Za-z_./-]+>"
color yellow "\\([\"'abfnrtv\\]|[0-3]?[0-7]{1,2}|x[A-Fa-f0-9]{1,2}|$)"
color brightblack "(^|[[:space:]])//.*"
color brightblack start="/\*" end="\*/"
comment "//"
color brightwhite,cyan "\<TODO\>:?"
color brightwhite,cyan "\<FIXME\>:?"
color ,red "[[:space:]]+$"
color brightyellow " + +| + +"
# rainbow indent
color ,brightblack "^[[:space:]]{32}"
color ,black "^[[:space:]]{30}"
color ,brightblack "^[[:space:]]{28}"
color ,black "^[[:space:]]{26}"
color ,brightblack "^[[:space:]]{24}"
color ,black "^[[:space:]]{22}"
color ,brightblack "^[[:space:]]{20}"
color ,black "^[[:space:]]{18}"
color ,brightblack "^[[:space:]]{16}"
color ,black "^[[:space:]]{14}"
color ,brightblack "^[[:space:]]{12}"
color ,black "^[[:space:]]{10}"
color ,brightblack "^[[:space:]]{8}"
color ,black "^[[:space:]]{6}"
color ,brightblack "^[[:space:]]{4}"
color ,black "^[[:space:]]{2}"