]> git.lizzy.rs Git - micro.git/blob - syntax_files/c.micro
Proper window resize handling
[micro.git] / syntax_files / c.micro
1 ## Here is an example for C/C++.
2 ##
3 syntax "C" "\.(c(c|pp|xx)?|C)$" "\.(h(h|pp|xx)?|H)$" "\.ii?$" "\.(def)$"
4 color identifier "\b[A-Z_][0-9A-Z_]+\b" 
5 color type "\b(float|double|bool|char|int|short|long|sizeof|enum|void|static|const|struct|union|typedef|extern|(un)?signed|inline)\b"
6 color type "\b((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\b"
7 color statement "\b(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\b"
8 color statement "\b(for|if|while|do|else|case|default|switch)\b"
9 color statement "\b(try|throw|catch|operator|new|delete)\b"
10 color statement "\b(goto|continue|break|return)\b"
11 color preproc "^[[:space:]]*#[[:space:]]*(define|include|(un|ifn?)def|endif|el(if|se)|if|warning|error)"
12 color brightmagenta "'([^'\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'"
13
14 ##
15 ## GCC builtins
16 color statement "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
17
18 #Operator Color
19 color statement "[.:;,+*|=!\%]" "<" ">" "/" "-" "&" 
20
21 #Parenthetical Color
22 # color magenta "[(){}]" "\[" "\]"
23
24
25 ##
26 ## String highlighting.  You will in general want your brightblacks and
27 ## strings to come last, because syntax highlighting rules will be
28 ## applied in the order they are read in.
29 color constant ""(\\.|[^"])*""
30 ##
31 ## This string is VERY resource intensive!
32 #color cyan (s) ""(\\.|[^"])*\\[[:space:]]*$.*?^(\\.|[^"])*""
33
34 ## Comment highlighting
35 color comment "//.*"
36 color comment (s) "/\*.*?\*/"
37
38 ## Trailing whitespace
39 #color ,green "[[:space:]]+$"