Syntax Highlighting with nano – nanorc for etc-stuff

## /etc/ stuff syntax
##
syntax "group" "group$"
color green "[0-9]\:.*$"
color brightwhite "[0-9]"
icolor brightred "^[[:space:]]*[.0-9A-Z_]*:"
 
syntax "modules" "modules.conf$" "modules.d/(\.|/|)"
color brightwhite "[0-9]"
color red "alias"
color brightred "(probeall|options)"
color green "#.*$"
 
syntax "modprobe" "modprobe.conf$"
color brightwhite "[0-9]"
color red "alias"
color brightred "options"
color magenta "[a-zA-Z0-9\_]+="
color green "#.*$"
 
syntax "hosts" "hosts$"
color brightwhite "[0-9]"
color cyan "\:\:"
color yellow "127.0.0.1"
color green "#.*$"
 
syntax "mplayer" "mplayer.conf$"
color brightgreen "\=.*$"
color brightred "no"
color cyan "\="
color green "#.*$"
 
syntax "mplayerplugin" "mplayerplug\-in.conf$"
color brightgreen "\=.*$"
color brightred "0"
color cyan "\="
color green "#.*$"
 
syntax "sensors" "sensors.conf$"
color brightyellow "\".*$"
color yellow "\<(label|compute|set|chip)\>"
color green "#.*$"
 
syntax "sysctl" "sysctl.conf$"
color brightwhite "[0-9]"
color cyan "\="
color green "#.*$"
 
syntax "dircolors" "DIR_COLORS$"
color yellow "\<(TERM|NORMAL|FILE|DIR|LINK|FIFO|SOCK|DOOR|BLK|CHR|ORPHAN|MISSING|SETUID|SETGID)\>"
color yellow "\<(STICKY|EXEC|STICKY_OTHER_WRITABLE|OTHER_WRITABLE)\>"
color brightblack "[0-9][0-9]\;.*$"
color cyan "\.[.0-9A-Z_]*[[:space:]]"
color green "#.*$"
 
syntax "modes" "fb.modes$"
color yellow "\<(mode|endmode)\>"
color cyan "\<(geometry|timings|hsync|vsync|double)\>"
color green "#.*$"
 
syntax "serial" "serial.conf$"
color brightwhite "[0-9]"
color cyan "\<(uart|port|irq|fourport)\>"
color green "#.*$"
 
syntax "services" "services$"
color cyan "/tcp"
color magenta "udp"
color brightblack "/"
color brightwhite "[0-9]"
color green "#.*$"
 
syntax "crontab" "crontab$"
color brightwhite "[0-9]"
color cyan "\*"
color yellow "[[:space:]]/.*$"
color brightblack "(&|>)"
color green "#.*$"
 
syntax "nscd" "nscd.conf$"
color cyan "(passwd|group|hosts)"
color yellow "([0-9]|yes)"
color green "#.*$"
 
syntax "rsync" "rsyncd.conf$"
color cyan "(hosts|(u|g)id|pid\ file|use\ chroot|read\ only|address|max\ connections|motd\ file)"
color cyan "(log\ format|syslog\ facility|timeout)"
color yellow "(path|comment|exclude)"
color brightyellow  start="\[" end="\]"
color green "#.*$"
 
syntax "lilo" "lilo.conf$"
color cyan "(boot|map|install|menu\-scheme|timeout|delay|prompt|vga|default)"
color brightwhite "[0-9]"
color magenta "(lba32|linear|compact|image)"
color brightyellow  "(root|label|read\-only)"
color yellow "\/.*$"
color green "#.*$"
 
syntax "hdparm" "hdparm$"
color cyan "(pata|sata)_all_args"
color cyan "[A-Za-z0-9]*_args"
color magenta "\".*$"
color green "#.*$"
 
syntax "ini" "\.ini$"
color yellow "\[.*]"
color green "\;.*$"
 
syntax "smbconf" "smb.conf$"
color brightcyan "\=.*$"
color cyan "\/.*$"
color brightred "(no|No)"
color brightgreen "(yes|Yes)"
color brightyellow "(workgroup.*$|hosts\ allow.*$|interfaces.*$|netbios\ name.*$)"
color yellow "\[.*]|\="
icolor magenta "^[[:space:]]*[.A-Z]*"
icolor magenta "^[[:space:]]*[.A-Z]*[[:space:]]*[.A-Z]*"
icolor magenta "^[[:space:]]*[.A-Z]*[[:space:]]*[.A-Z]*[[:space:]]*[.A-Z]*"
color green "\;.*$"
color green "#.*$"
 
syntax "mke2fs" "mke2fs.conf$"
color cyan "(base_features|blocksize|inode_ratio)"
color yellow "(small|floppy|news|largefile|largefile4)"
color brightwhite "[0-9]"
color brightyellow  start="\[" end="\]"
color blue "\{|\}"
color brightblack "\="
color green "#.*$"
 
#this on may need fewer colors ;)
syntax "squidconf" "squid.conf$"
color brightyellow "(http_port|hierarchy_stoplist|maximum_object_size|cache_dir|dns_testnames)"
color brightyellow "(coredump_dir|pipeline_prefetch|cache_mgr|visible_hostname|ftp_user|client_netmask)"
color cyan "(acl|refresh_pattern|quick_abort_(min|max)|(cache|memory)_replacement_policy|(access|cache|cache_store)_log|cache_host)"
color yellow "((http|icp|snmp)_access|snmp_port|parent|sibling|anonymize_headers|fake_user_agent)"
color brightgreen "(allow|transparent|[[:space:]]on)"
color brightred "(deny|reload\-into\-ims|override\-expire|override\-lastmod|[[:space:]]off)"
color magenta "(src|dst|method)"
color brightcyan "(seconds|minutes|hours|(G|M|K)B)"
color brightblack "[0-9]"
color green "#.*$"
 
syntax "distcchosts" "/etc/distcc/hosts$"
color brightblue "[0-9]"
color yellow "localhost"
color magenta "(/|@|:)"
color green "#.*$"
 
syntax "logrotate" "logrotate.conf$"
color brightwhite "[0-9]"
color magenta start="/" end="[[:space:]]"
color cyan "(create|compress|include|notifempty|nomail|noolddir|\{|\})"
color yellow "(weekly|daily|rotate|postrotate|sharedscripts)"
color magenta "logrotate"
color green "#.*$"
 
syntax "ppppears" "/etc/ppp/peers/(\.|/|)"
color brightwhite "user.*$"
color brightyellow "user"
color brightyellow start="\"" end="\""
color yellow "lcp\-(echo\-(interval|failure)|max\-configure|restart)"
color yellow "(debug|sync|no(ccp|pcomp|accomp)|deflate|bsdcomp|usepeerdns|pty)"
color cyan "(lock|defaultroute|noipdefault|noauth|holdoff|maxfail|persist|asyncmap|detach|updetach|cdtrcts)"
color brightwhite "[0-9]"
color magenta "(\@|\,|\.)"
color green "#.*$"
 
syntax "dhcpconf" "dhcpd.conf$"
icolor brightgreen "^[[:space:]]*[.A-Z]*[[:space:]]*[.A-Z]*"
color cyan "(authoritative|ddns\-update\-style|subnet|host)"
color brightblue "(netmask|routers|option|domain-nam(e|e-servers)|(default|max)-lease-time)|range|broadcast\-address"
color brightyellow  start="\"" end="\""
color yellow  "(hardware|ethernet|fixed\-address)"
color brightblack "\:|\;|\{|\})""
color green "#.*$"
 
syntax "hibernateconf" "/etc/hibernate/common.conf$"
color magenta "^[[:space:]]*[.A-Z]*"
color brightwhite start="'" end="'"
color brightgreen "yes"
color brightred "no"
color brightcyan "auto"
color green "#.*$"
color brightcyan "##.*$"
color yellow "###.*$"
color cyan "####.*$"
 
syntax "nsswitch" "nsswitch.conf$"
icolor cyan "^[[:space:]]*[.0-9A-Z_]*:"
color magenta "\:"
color green "#.*$"
 
syntax "sane" "sane.d/(\.|/|)"
color brightgreen "(scsi|usb|parport|auto)"
color brightred "option"
color yellow "(override|vendor|model)"
color cyan "/.*$"
color green "#.*$"
 
syntax "syslogconf" "syslog.conf$"
icolor cyan "(\*|\;|\.|\,|\\)"
color magenta "/.*$"
color brightblue "-.*$"
color brightwhite "\="
color green "#.*$"
 
## these colors need to change...
syntax "udevrules" "\.rules$"
color brightwhite "[0-9]"
color brightblack "(ACTION|SUBSYSTEM|DEVPATH|OPTIONS|WAIT_FOR_SYSFS|ENV|KERNEL|NAME|MODE|GROUP|SYMLINK|DRIVERS|PROGRAM|RUN)"
color brightblack "(GOTO|IMPORT|ATTRS|SUBSYSTEMS|DVB|IR|BUS|SYSFS|ATTR|LABEL)"
color yellow "(add|net|scsi|drivers|module|address|bus|devices|ioerr_cnt|ignore_device|svga|video|tt(y(S|USB)|y|s)|last_rule)"
color yellow "(pnp|(au|ra)dio|tape|disk|snd|microcode|f(b|d|loppy|irmware)|usb|lp|kbd|parport|block|ide|misc|netlink|input)"
color yellow "(mouse|event|joystick|psmouse|atkbd|spkr|pcspkr|ir|dvb|persistent|storage|end|scanner|sound|dialout|console)"
color yellow "(cdrom|cdrw|dvd|dvdrw|isdn|pty|vcs|vcsa|ippp|dcbri|ircomm|capi|card|nvidia|rtc|agpgart|psaux|ptmx|sd|dasd|)"
color yellow "(ataraid|cciss|ida|rd|3dfx|control|hw|pcm|midi|timer|seq|cpu|msr|dm|i2c|mice|js|ts|loop|md|uinput|inotify|aoe)"
color brightyellow "(ID_(SERIAL|PATH|CLASS|EDD|CDROM|CDROM_(DVD|DVD_R|CD_RW))|program|parent|removable|GENERATED|COMMENT)"
color brightyellow "(id(Vendor|Product)|PHYSDEVBUS|(UDEV|UDEVD)_EVENT|INTERFACE_NEW|MODALIAS|modalias|alias|name)"
color brightred "(\%(k|r|c|n))"
color blue "(\;|\.|\"|\,)"
color brightblue "(\=|\*|\?)"
color green "#.*$"
 
syntax "mailalias" "/etc/mail/aliases$"
icolor brightblue "^[[:space:]]*[.0-9A-Z_]*:"
icolor brightblue "^[[:space:]]*[.0-9A-Z_]*\-[.0-9A-Z_]*:"
color yellow "(\/.*$|root)"
color green "#.*$"
 
syntax "wifiradar" "wifi-radar.conf$"
color brightwhite "[0-9]"
color yellow "((f|F)alse|eth[.0-9])|yes|no|[[:space:]]auto|ssid"
color brightgreen start="\[" end="\]"
color green "#.*$"
 
syntax "irssi" "irssi.conf$"
icolor brightwhite "(^[[:space:]]*[.0-9A-Z_]*[[:space:]]=|address|name|chatnet|port|autojoin)"
color brightblue ""(\\.|[^\"])*""
color yellow "(\{|\}|\;)"
color brightblack "\="
color brightgreen "(Y|y)es|[0-9]"
color brightred "No"
color blue "\""
color cyan "(servers|chatnets|channels|aliases|statusbar)"
color green "#.*$"
 
syntax "proftpd" "proftpd.conf$"
icolor yellow "^[[:space:]]*[.0-9A-Z_]*[[:space:]]"
color brightyellow "ServerType|DefaultServer|ServerIdent|Port[[:space:]]|Umask|MaxInstances|User|Group"
color yellow "(UserAlias|UseFtpUsers)"
color brightgreen "([[:space:]]on|[0-9]|AllowAll)"
color brightred "(off|DenyAll)"
icolor cyan start="<" end=">"
icolor cyan start=""" end="""
color cyan "xinetd|inetd|standalone"
color green "#.*$"
 
syntax "xinetd" "xinetd.conf$"
icolor yellow "^[[:space:]]*[.0-9A-Z_]*[[:space:]]"
color brightgreen "([0-9]|yes)"
color brightred "(off|no)"
color magenta "defaults"
color brightblack "="
color brightyellow "(\{|\})"
color cyan "/.*$"
color green "#.*$"
 
syntax "xinetd.d" "xinetd.d/(\.|/|)"
icolor yellow "^[[:space:]]*[.0-9A-Z_]*[[:space:]]"
color brightgreen "([0-9]|yes)"
color brightred "(off|[[:space:]]no)"
color brightblack "="
color brightyellow "(\{|\})"
color cyan "/.*$"
color green "#.*$"
 
syntax "localegen" "locale(.gen|s.build)"
color cyan "ISO.*$"
color yellow "UTF.*$"
color green "#.*$"
 
syntax "clamd" "clamd.conf$"
color brightblack "[0-9]M"
color brightwhite "[0-9]"
color yellow "^[[:space:]]*[.0-9A-Z_]*"
color cyan "^[[:space:]]*[.0-9A-Z_]*[[:space:]]"
color green "#.*$"
 
syntax "grcconf" "grc.conf$"
color cyan "conf\..*$"
color yellow "\(.*$|\\.*$"
color green "#.*$"
 
syntax "freshclamconf" "freshclam.conf$"
icolor brightcyan "^[[:space:]]*[.A-Z]*[[:space:]]*[.A-Z_]*"
color cyan "\/.*$|[0-9]"
icolor yellow "^[[:space:]]*[.A-Z]*"
color green "#.*$"

Leave a Reply

Your email address will not be published. Required fields are marked *