c.nanorc 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 brightred "\<[A-Z_][0-9A-Z_]+\>"
  5. color green "\<(float|double|bool|char|int|short|long|sizeof|enum|void|static|const|struct|union|typedef|extern|(un)?signed|inline)\>"
  6. color green "\<((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\>"
  7. color green "\<(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\>"
  8. color green "\<(for|if|while|do|else|case|default|switch)\>"
  9. color green "\<(try|throw|catch|operator|new|delete)\>"
  10. color brightmagenta "\<(goto|continue|break|return)\>"
  11. color brightcyan "^[[: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. ## GCC builtins
  15. color green "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
  16. #Operator Color
  17. color yellow "[.:;,+*|=!\%]" "<" ">" "/" "-" "&"
  18. #Parenthetical Color
  19. color magenta "[(){}]" "\[" "\]"
  20. ##
  21. ## String highlighting. You will in general want your comments and
  22. ## strings to come last, because syntax highlighting rules will be
  23. ## applied in the order they are read in.
  24. color cyan "<[^= ]*>" ""(\\.|[^"])*""
  25. ##
  26. ## This string is VERY resource intensive!
  27. #color cyan start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
  28. ## Comment highlighting
  29. color brightblue "//.*"
  30. color brightblue start="/\*" end="\*/"
  31. ## Trailing whitespace
  32. #color ,green "[[:space:]]+$"