--- nano/doc/syntax/c.nanorc 2015-12-30 14:06:23.252569068 -0500 +++ c-working.nanorc 2015-12-30 14:28:45.597361809 -0500 @@ -13,22 +13,26 @@ color brightcyan "^[[:space:]]*#[[:space:]]*(define|include(_next)?|(un|ifn?)def|endif|el(if|se)|if|warning|error|pragma)" color brightmagenta "'([^'\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'" -# GCC builtins. +## GCC builtins. color cyan "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__" -# Strings. In general you will want your strings and comments to come last, -# because highlighting rules are applied in the order they are read in. -color brightyellow "<[^= ]*>" ""(\\.|[^"])*"" -# Multiline strings. This regex is VERY resource intensive, -# and sometimes colours things that shouldn't be coloured. -###color brightyellow start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*"" +## Strings. In general you will want your strings and comments to come last, +## because highlighting rules are applied in the order they are read in. +color brightwhite ""[^"\\]*"" +## CPP directives. They need to go after strings because the can include strings. +color brightwhite,cyan "^[[:blank:]]*#[[:blank:]]*(define|(un|ifn?)def|endif|el(if|se)|if|warning|error|pragma)[[:graph:]]*" +## This highlights the includes. +color brightwhite,cyan "[[:blank:]]*#[[:blank:]]*include(_next)?[[:blank:]]*(<[^[:blank:]="\\]*>|"[^[:blank:]="\\]*")" -# Comments. +## Comments. color brightblue "//.*" color brightblue start="/\*" end="\*/" -# Reminders. +## Highlighting FIXME. +color brightyellow,yellow "/?\*?/?FIXME(!|\?|\.)*\*?/?" + +## Reminders. color ,yellow "(FIXME|TODO|XXX)" -# Trailing whitespace. +## Trailing whitespace. color ,green "[[:space:]]+$"