Syntax Highlighting with nano – nanorc for configfiles

### all *conf files  (e.g. make.conf, xorg.conf, grub.conf, make.globals, Xfce files...)
syntax "configfiles" "(\.|/|)conf$" "(\.|/|)ample$" "(\.|/|)globals$" "xfce.*$" "syslog-ng" "sudoers"
color brightwhite "\<(alias)\>"
color blue "<(\\.|[^'])*>"
color magenta "[a-zA-Z0-9\_]+="
color white ">(\\.|[^'><])*</"
color green "//.*$"
color red ""(\\.|[^\"])*""
color red "title.*$" "\<(server)\>" "\<(logfile)\>" "\<(driftfile)\>" "\<(restrict)\>"
color white ":unscaled" "http\:\/\/" "ftp\:\/\/" "rsync\:\/\/"
color magenta "'(\\.|[^'])*'"
color brightwhite "[0-9]"
color brightwhite "[<>]"
color magenta "Section" "EndSection" "SubSection" "EndSubSection"
color red "\<(root)\>"
color brightred,blue "^.*-->" start="<!--.*" end="$"
color green "#.*$" start="<!--" end="-->"

Syntax Highlighting with nano – nanorc for config3

### even more config files ;-)
syntax "config3" "iptables" "ntp.*$" "rsyncd" "xfs" "saslauthd" "timidity" "net.*$" "hdparm" "esound" "login.*$"
color red "/.*$" "http\:\/\/.*$" ""(\\.|[^\"])*"" "\<(server)\>" "\<(logfile)\>""\<(driftfile)\>"
color white ":unscaled" "http\:\/\/" "ftp\:\/\/" "rsync\:\/\/"
color blue "setenv|export"
color brightwhite "[0-9]"
color green "#.*$"

Syntax Highlighting with nano – nanorc for config2

### more config files
syntax "config2" "(\.|/|)env$" "(\.|/|)server.$" "hosts" "gpm" "local.*$" "bootsplash" "crypto-loop"
color red "/.*$" "http\:\/\/.*$"
color white ":unscaled"
color blue "setenv|export"
color brightwhite "[0-9]"
color green "#.*$"
color white "http\:\/\/" "ftp\:\/\/" "rsync\:\/\/"

Syntax Highlighting with nano – nanorc for conf

# Generic *.conf file syntax highlighting
#
 
syntax "conf" "\.(c(onf|nf|fg))$"
 
# string
icolor yellow ""(\\.|[^"])*""
 
# variable name & value
icolor brightyellow start="=" end="$"
icolor magenta start="(^|[[:space:]])[0-9a-z-]" end="="
 
# bracket/parenthesis
icolor brightred "(^|[[:space:]])((\[|\()[0-9a-z_!@#$%^&*-]+(\]|\)))"
 
# number
color green "[[:space:]][0-9.KM]+"
 
# comment
color cyan start="(^|[[:space:]])(#|;).*$" end="$"
color brightblue "(^|[[:space:]])(#|;)"

Syntax Highlighting with nano – nanorc for clike

## Here is an example for C/C++.
##
syntax "clike" "\.(m|pch)$"
color brightred "\<[A-Z_][0-9A-Z_]+\>" 
color green "\<(float|double|bool|char|int|short|long|sizeof|enum|void|static|const|struct|union|typedef|extern|(un)?signed|inline)\>"
color green "\<((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\>"
color green "\<(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\>"
color brightyellow "\<(for|if|while|do|else|case|default|switch)\>"
color brightyellow "\<(try|throw|catch|operator|new|delete)\>"
color magenta "\<(goto|continue|break|return)\>"
color brightcyan "^[[:space:]]*#[[:space:]]*(define|include|(un|ifn?)def|endif|el(if|se)|if|warning|error)"
color brightmagenta "'([^'\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'"
##
## GCC builtins
color cyan "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
##
## String highlighting.  You will in general want your comments and
## strings to come last, because syntax highlighting rules will be
## applied in the order they are read in.
color brightyellow "<[^= 	]*>" ""(\\.|[^"])*""
##
## This string is VERY resource intensive!
color brightyellow start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
 
## Comment highlighting
color brightblue "//.*"
color brightblue start="/\*" end="\*/"

Syntax Highlighting with nano – nanorc for changelogs

## Changelog file syntax
##
syntax "changelogs" "ChangeLog*$" "HISTORY$" "NEWS$"
 
color green "\+"
color red "\-"
color brightwhite "[0-9]"
color brightblue "[0-9][0-9]\:[0-9][0-9]\:[0-9][0-9]"
color blue "[0-9][0-9][0-9][0-9]\-[0-9][0-9]\-[0-9][0-9]"
color blue "[0-9][0-9][0-9][0-9]\/[0-9][0-9]\/[0-9][0-9]"
color blue "\<(CEST|CET|CST||CDT|EDT)\>"
color yellow "[0-9]\..*$"
color cyan "\*.*$"
color brightblue "\<(pre.*$|beta.*$|rc.*$|release.*$)\>"
color green "#.*$"
icolor brightred "^[[:space:]]*[.0-9A-Z_]*:"
color magenta "[.0-9A-Za-z_]*[[:space:]]*[.0-9A-Za-z_]*[[:space:]]<"
color brightyellow  "<(\\.|[^\"])*>"
color brightwhite "commit[[:space:]]*[.0-9A-Z_]*$"

Syntax Highlighting with nano – nanorc for changelog

syntax "changelog" "ChangeLog$"
color brightgreen "^\+.*"
color green "^\+\+\+.*"
color brightblue "^ .*"
color brightred "^-.*"
color red "^---.*"
color red "(\d\d\s\w\+\s\d\{4\})"
color brightyellow "^@@.*"
color magenta "^diff.*"
 
#syn region GentooChangeLogRelease start=/^\*/ end=/$/ contains=GentooChangeLogReleaseDate
#syn match GentooChangeLogReleaseDate contained /(\d\d\s\w\+\s\d\{4\})/
#syn region GentooChangeLogEntry start=/^\s\+/ end=/\n\n/
#           \ contains=GentooChangeLogEntryDate,GentooBug
#syn region GentooChangeLogEntryDate contained start=/\d\?\d\s\w\+\s\d\{4\}/ end=/;/
#           \ nextgroup=GentooChangeLogEntryAuthor,GentooChangeLogEntryEmail skipwhite skipnl
#syn region GentooChangeLogEntryAuthor contained start=/\S/ end=/\( <\)\@=/
#           \ nextgroup=GentooChangeLogEntryEmail skipwhite skipnl
#syn match  GentooChangeLogEntryEmail contained /<\?[a-zA-Z0-9\.\-\_]\+@[a-zA-Z0-9\.\-\_]\+>\?/
#           \ nextgroup=GentooChangeLogFiles skipwhite skipnl
#syn region GentooChangeLogFiles contained start=/\(\S\)\@=/ end=/:/
#           \ contains=GentooChangeLogAddFile,GentooChangeLogDelFile,GentooChangeLogModFile
#" Add / delete / changed files
#syn region GentooChangeLogAddFile contained start=/+/ end=/\([,:]\)\@=/
#syn region GentooChangeLogDelFile contained start=/-/ end=/\([,:]\)\@=/
#syn region GentooChangeLogModFile contained start=/[a-zA-Z0-9]/ end=/\([,:]\)\@=/

Syntax Highlighting with nano – nanorc for c

## Here is an example for C/C++.
##
syntax "c" "\.(c(c|pp|xx)?|C)$" "\.(h(h|pp|xx)?|H)$" "\.ii?$"
color brightred "\<[A-Z_][0-9A-Z_]+\>" 
color green "\<(float|double|bool|char|int|short|long|sizeof|enum|void|static|const|struct|union|typedef|extern|(un)?signed|inline)\>"
color green "\<((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\>"
color green "\<(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\>"
color brightyellow "\<(for|if|while|do|else|case|default|switch)\>"
color brightyellow "\<(try|throw|catch|operator|new|delete)\>"
color magenta "\<(goto|continue|break|return)\>"
color brightcyan "^[[:space:]]*#[[:space:]]*(define|include|(un|ifn?)def|endif|el(if|se)|if|warning|error)"
color brightmagenta "'([^'\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'"
##
## GCC builtins
color cyan "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
##
## String highlighting.  You will in general want your comments and
## strings to come last, because syntax highlighting rules will be
## applied in the order they are read in.
color brightyellow "<[^= 	]*>" ""(\\.|[^"])*""
##
## This string is VERY resource intensive!
color brightyellow start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
 
## Comment highlighting
color brightblue "//.*"
color brightblue start="/\*" end="\*/"

Syntax Highlighting with nano – nanorc for awk

## Here is an example for awk.
##
syntax "awk" "\.awk$"
## records
icolor brightred "\$[0-9A-Z_!@#$*?-]+"
## awk-set variables
color red "\<(ARGC|ARGIND|ARGV|BINMODE|CONVFMT|ENVIRON|ERRNO|FIELDWIDTHS)\>"
color red "\<(FILENAME|FNR|FS|IGNORECASE|LINT|NF|NR|OFMT|OFS|ORS)\>"
color red "\<(PROCINFO|RS|RT|RSTART|RLENGTH|SUBSEP|TEXTDOMAIN)\>"
## function declarations and special patterns
color brightgreen "\<(function|extension|BEGIN|END)\>"
## operators
color green "(\{|\}|\(|\)|\;|\]|\[|\\|<|>|!|=|&|\+|-|\*|%|/|\?:|\^|\|)"
## flow control
color brightyellow "\<(for|if|while|do|else|in|delete|exit)\>"
color brightyellow "\<(break|continue|return)\>"
## I/O statements
color brightgreen "\<(close|getline|next|nextfile|print|printf)\>"
color brightgreen "\<(system|fflush)\>"
## standard functions
color magenta "\<(atan2|cos|exp|int|log|rand|sin|sqrt|srand)\>"
color magenta "\<(asort|asorti|gensub|gsub|index|length|match)\>"
color magenta "\<(split|sprintf|strtonum|sub|substr|tolower|toupper)\>"
color magenta "\<(mktime|strftime|systime)\>"
color magenta "\<(and|compl|lshift|or|rshift|xor)\>"
color magenta "\<(bindtextdomain|dcgettext|dcngettext)\>"
 
##
## String highlighting.  You will in general want your comments and
## strings to come last, because syntax highlighting rules will be
## applied in the order they are read in.
color brightyellow "<[^= 	]*>" ""(\\.|[^"])*""
 
## Comment highlighting
color brightblue "(^|[[:space:]])#.*$"
 
## Trailing whitespace
color ,green "[[:space:]]+$"