Skip to content

Instantly share code, notes, and snippets.

@kapb14
Created August 9, 2019 17:50
Show Gist options
  • Select an option

  • Save kapb14/ee4ff9d08e39c3528ccdfd1becc14c28 to your computer and use it in GitHub Desktop.

Select an option

Save kapb14/ee4ff9d08e39c3528ccdfd1becc14c28 to your computer and use it in GitHub Desktop.

Revisions

  1. kapb14 created this gist Aug 9, 2019.
    785 changes: 785 additions & 0 deletions combined_syntax.nanorc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,785 @@
    ## dotfiles
    ##
    syntax "dotfile" "\.*$"
    color cyan start="(^|[[:space:]])(#|;).*$" end="$"
    color brightyellow start="=" end="$"


    ## Generic *.conf file syntax highlighting
    ##
    syntax "conf" "\.(conf|cnf|cfg|config|cf)$"
    #syntax "conf" "\.(c(onf|nf|fg))$"
    icolor yellow ""(\\.|[^"])*""
    icolor brightyellow start="=" end="$"
    icolor brightgreen start="(^|[[:space:]])[0-9a-z-]" end="="
    icolor brightred "(^|[[:space:]])((\[|\()[0-9a-z_!@#$%^&*-]+(\]|\)))"
    color green "[[:space:]][0-9.KM]+"
    color cyan start="(^|[[:space:]])(#|;).*$" end="$"
    color brightcyan "(^|[[:space:]])(#|;)"


    ## bind
    ##
    syntax "bind" "\/(named|bind)\/*\.(ru|com|net)$" "\.(ru|com)$"
    color brightcyan,green "[a-z._\-]{1,}\."
    color white,blue "\<(ns|nss)\.adv\.ru\."
    color black,blue "admins\.adv\.ru\."
    color white,cyan "(mx|mail|jump|haproxy-(tcp|http)|europe1|eu1)\.adv\.ru\."
    color cyan start="(^|[[:space:]])(#|;).*$" end="$"
    color brightcyan "\<(IN|)\>"
    color brightcyan "(^|[[:space:]])(#|;)"
    color brightcyan "\<(SOA|TXT|CNAME|A|MX|NS|SRV)\>"
    color black,red "\<(SRV|TXT)\>"
    color black,blue "\<CNAME\>"
    color black,cyan "\<A\>"
    color ,magenta "\<NS\>"
    color black,yellow "\<MX\>"
    color brightyellow,green "^\*\.[a-z]{1,}"
    #color black,blue "\<(serial|refresh|retry|expire|minimum)\>"
    color yellow "\<\(@|www)\>"
    color brightyellow start="^([a-z0-9._\-]|@)" end="[[:space:]]"
    color black,yellow start="\<MX\>" end="($|;)"
    color black,magenta start="\<NS\>" end="($|;)"
    color magenta "\<(\$TTL|TTL|3600|7200|1800)\>"
    color brightred "\<[0-9]{8,11}\>"
    color brightmagenta "\<[0-9]{2,8}\>"
    icolor green ""(\\.|[^"])*""



    ## bash
    ##
    syntax "bash" "\.sh$" "\.(bashrc|bash_profile|profile|bash.bashrc)$"
    header "^#!.*/(env +)?[bg]?bash( |$)" "^#!\/bin\/sh( |$)"
    # Control
    color magenta "\<(if|else|for|function|case|esac|in|select|until|while|do|elif|then|set|\.|done|fi)\>"
    # Brackets and redirects
    color yellow "[(){}[;|<>]"
    color yellow "\]"
    # Builtins
    color brightred "\<(source|alias|bg|bind|break|builtin|cd|command|compgen|complete|continue|dirs|disown|echo|enable|eval|exec|exit|fc|fg|getopts|hash|help|history|jobs|kill|let|logout|popd|printf|pushd|pwd|return|set|shift|shopt|suspend|test|times|trap|type|ulimit|umask|unalias|wait)\>"
    # Unix Commands
    color red "\<(arch|awk|bash|bunzip2|bzcat|bzcmp|bzdiff|bzegrep|bzfgrep|bzgrep|bzip2|bzip2recover|bzless|bzmore|cat|chattr|chgrp|chmod|chown|chvt|cp|date|dd|deallocvt|df|dir|dircolors|dmesg|dnsdomainname|domainname|du|dumpkeys|echo|ed|egrep|false|fgconsole|fgrep|fuser|gawk|getkeycodes|gocr|grep|groups|gunzip|gzexe|gzip|hostname|igawk|install|kbd_mode|kbdrate|killall|last|lastb|link|ln|loadkeys|loadunimap|login|ls|lsattr|lsmod|lsmod.old|mapscrn|mesg|mkdir|mkfifo|mknod|mktemp|more|mount|mv|nano|netstat|nisdomainname|openvt|pgawk|pidof|ping|ps|pstree|pwd|rbash|readlink|red|resizecons|rm|rmdir|run-parts|sash|sed|setfont|setkeycodes|setleds|setmetamode|setserial|sh|showkey|shred|sleep|ssed|stat|stty|su|sync|tar|tempfile|touch|true|umount|uname|unicode_start|unicode_stop|unlink|utmpdump|uuidgen|vdir|wall|wc|ypdomainname|zcat|zcmp|zdiff|zegrep|zfgrep|zforce|zgrep|zless|zmore|znew|zsh)\>"
    # More Unix Commands
    color red "\<(aclocal|aconnect|aplay|apm|apmsleep|apropos|ar|arecord|as|as86|autoconf|autoheader|automake|awk|basename|bc|bison|c++|cal|cat|cc|cdda2wav|cdparanoia|cdrdao|cd-read|cdrecord|chfn|chgrp|chmod|chown|chroot|chsh|clear|cmp|co|col|comm|cp|cpio|cpp|cut|dc|dd|df|diff|diff3|dir|dircolors|directomatic|dirname|du|env|expr|fbset|file|find|flex|flex++|fmt|free|ftp|funzip|fuser|g++|gawk|gc|gcc|gdb|getent|getopt|gettext|gettextize|gimp|gimp-remote|gimptool|gmake|gs|head|hexdump|id|install|join|kill|killall|ld|ld86|ldd|less|lex|ln|locate|lockfile|logname|lp|lpr|ls|lynx|m4|make|man|mkdir|mknod|msgfmt|mv|namei|nasm|nawk|nice|nl|nm|nm86|nmap|nohup|nop|od|passwd|patch|pcregrep|pcretest|perl|perror|pidof|pr|printf|procmail|prune|ps2ascii|ps2epsi|ps2frag|ps2pdf|ps2ps|psbook|psmerge|psnup|psresize|psselect|pstops|rcs|rev|rm|scp|sed|seq|setterm|shred|size|size86|skill|slogin|snice|sort|sox|split|ssh|ssh-add|ssh-agent|ssh-keygen|ssh-keyscan|stat|strings|strip|sudo|suidperl|sum|tac|tail|tee|test|tr|uniq|unlink|unzip|updatedb|updmap|uptime|users|vmstat|w|wc|wget|whatis|whereis|which|who|whoami|write|xargs|yacc|yes|zip|zsoelim)\>"
    # Strings
    color brightcyan "\"(\\.|[^\"])*\""
    color brightcyan "'(\\.|[^\"])*'"
    # Variables, keep it below the strings, such that vars are highlighted inside strings.
    color brightgreen start="[$@%]" end="[[:alnum:]]*"
    # operands
    color white,blue "\<(\&\&|\|\||\||\;)\>"
    # Comments
    color cyan "#.*$"


    ## iptables (fw)
    ##
    syntax "fw" "\/etc\/firewall" "firewall$" "firewall\.sh$"
    #color brightyellow "\$(\{|)[A-Za-z_]{0,15}(\}|)"
    #color brightred start="[$@%]" end="[[:alnum:]]*"
    color brightyellow start="[$@%]" end="[[:space:]]"
    color yellow "[(){}[;|<>]"
    color yellow "\]"
    color brightcyan "\"(\\.|[^\"])*\""
    color brightcyan "'(\\.|[^\"])*'"
    color yellow start="^[A-Z][A-Za-z0-9_]{0,20}" end="(=)"
    color brightred start="modprobe" end="$"
    color magenta "=" "\<(nat|raw)\>"
    color brightblue "(eth|tun|tap|dev|br|gre)[0-9]{0,3}?\.[0-9]{0,3}" "(eth|tun|tap|dev|br|gre)[0-9]{0,3}"
    color yellow ":[0-9]{2,5}" "[[:space:]]\<[0-9]{2,5}\>"
    color brightwhite "(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])"
    color brightmagenta "(((128|192|224|240|248|252|254)\.0\.0\.0)|(255\.(0|128|192|224|240|248|252|254)\.0\.0)|(255\.255\.(0|128|192|224|240|248|252|254)\.0)|(255\.255\.255\.(0|128|192|224|240|248|252|254)))"
    color brightwhite,green "\<(ACCEPT|ALLOW|)\>"
    color brightwhite,red "\<(DENY|DROP|REJECT)\>"
    color black,green "\<(SNAT)\>"
    color black,blue "\<(DNAT)\>"
    #color brightblue "\<(nat|comment|raw|-(t|i|o|s|-to-source|j|p|m|-dport|-comment|-to-destination|-reject-with|tcp-reset|A))\>"
    color brightblue "(--(to-source|comment|dport|to-destination|reject-with))" "\<(comment|tcp-reset)\>"
    color brightcyan "(-([A-Za-z]{1})[[:space:]])"
    color yellow "\<(INPUT|FORWARD|OUTPUT)\>"
    color blue "\<(PREROUTING|tcp)\>"
    color green "\<(POSTROUTING|udp)\>"
    color white,blue "\<(\&\&|\|\||\||\;)\>"
    color cyan "#.*$"
    color brightgreen start="[[:space:]]\"" end="\"([[:space:]]|$|)"
    color white,blue "\$WAN0"
    color white,green "\$WAN1"
    color white,cyan "\$WAN2"
    color white,magenta "\$WAN3"
    color white,red "\$WAN4"
    color black,yellow "\$LAN0"



    ## nginx
    ##
    syntax "nginx" "nginx.*\.conf$" "\.nginx$"
    header "^(server|upstream)[a-z ]*\{$"
    color white,blue start="(upstream|server_name)[[:space:]]" end=" "
    color brightmagenta "\<(events|server|http|location|upstream)[[:space:]]*\{"
    color yellow "(include|internal)"
    color green "(fastcgi_pass|proxy_pass)"
    color brightred "(set|auth_pam|auth_pam_service_name|auth_request|)"
    color brightgreen "(^|[[:space:]{;])(access_log|add_after_body|real_ip_recursive|add_before_body|add_header|addition_types|aio|alias|allow|ancient_browser|ancient_browser_value|auth_basic|auth_basic_user_file|autoindex|autoindex_exact_size|autoindex_localtime|break|charset|charset_map|charset_types|chunked_transfer_encoding|client_body_buffer_size|client_body_in_file_only|client_body_in_single_buffer|client_body_temp_path|client_body_timeout|client_header_buffer_size|client_header_timeout|client_max_body_size|connection_pool_size|create_full_put_path|daemon|dav_access|dav_methods|default_type|deny|directio|directio_alignment|disable_symlinks|empty_gif|env|error_log|error_page|expires|fastcgi_buffer_size|fastcgi_buffers|fastcgi_busy_buffers_size|fastcgi_cache|fastcgi_cache_bypass|fastcgi_cache_key|fastcgi_cache_lock|fastcgi_cache_lock_timeout|fastcgi_cache_min_uses|fastcgi_cache_path|fastcgi_cache_use_stale|fastcgi_cache_valid|fastcgi_connect_timeout|fastcgi_hide_header|fastcgi_ignore_client_abort|fastcgi_ignore_headers|fastcgi_index|fastcgi_intercept_errors|fastcgi_keep_conn|fastcgi_max_temp_file_size|fastcgi_next_upstream|fastcgi_no_cache|fastcgi_param|fastcgi_pass_header|fastcgi_read_timeout|fastcgi_send_timeout|fastcgi_split_path_info|fastcgi_store|fastcgi_store_access|fastcgi_temp_file_write_size|fastcgi_temp_path|flv|geo|geoip_city|geoip_country|gzip|gzip_buffers|gzip_comp_level|gzip_disable|gzip_http_version|gzip_min_length|gzip_proxied|gzip_static|gzip_types|gzip_vary|if|if_modified_since|ignore_invalid_headers|image_filter|image_filter_buffer|image_filter_jpeg_quality|image_filter_sharpen|image_filter_transparency|index|ip_hash|keepalive|keepalive_disable|keepalive_requests|keepalive_timeout|large_client_header_buffers|limit_conn|limit_conn_log_level|limit_conn_zone|limit_except|limit_rate|limit_rate_after|limit_req|limit_req_log_level|limit_req_zone|limit_zone|lingering_close|lingering_time|lingering_timeout|listen|location|log_format|log_not_found|log_subrequest|map|map_hash_bucket_size|map_hash_max_size|master_process|max_ranges|memcached_buffer_size|memcached_connect_timeout|memcached_next_upstream|memcached_pass|memcached_read_timeout|memcached_send_timeout|merge_slashes|min_delete_depth|modern_browser|modern_browser_value|mp4|mp4_buffer_size|mp4_max_buffer_size|msie_padding|msie_refresh|open_file_cache|open_file_cache_errors|open_file_cache_min_uses|open_file_cache_valid|open_log_file_cache|optimize_server_names|override_charset|pcre_jit|perl|perl_modules|perl_require|perl_set|pid|port_in_redirect|postpone_output|proxy_buffer_size|proxy_buffering|proxy_buffers|proxy_busy_buffers_size|proxy_cache|proxy_cache_bypass|proxy_cache_key|proxy_cache_lock|proxy_cache_lock_timeout|proxy_cache_min_uses|proxy_cache_path|proxy_cache_use_stale|proxy_cache_valid|proxy_connect_timeout|proxy_cookie_domain|proxy_cookie_path|proxy_hide_header|proxy_http_version|proxy_ignore_client_abort|proxy_ignore_headers|proxy_intercept_errors|proxy_max_temp_file_size|proxy_next_upstream|proxy_no_cache|proxy_pass_header|proxy_read_timeout|proxy_redirect|proxy_send_timeout|proxy_set_header|proxy_ssl_session_reuse|proxy_store|proxy_store_access|proxy_temp_file_write_size|proxy_temp_path|random_index|read_ahead|real_ip_header|recursive_error_pages|request_pool_size|reset_timedout_connection|resolver|resolver_timeout|return|rewrite|root|satisfy|satisfy_any|secure_link_secret|send_lowat|send_timeout|sendfile|sendfile_max_chunk|server|server|server_name|server_name_in_redirect|server_names_hash_bucket_size|server_names_hash_max_size|server_tokens|set_real_ip_from|source_charset|split_clients|ssi|ssi_silent_errors|ssi_types|ssl|ssl_certificate|ssl_certificate_key|ssl_ciphers|ssl_client_certificate|ssl_crl|ssl_dhparam|ssl_engine|ssl_prefer_server_ciphers|ssl_protocols|ssl_session_cache|ssl_session_timeout|ssl_verify_client|ssl_verify_depth|sub_filter|sub_filter_once|sub_filter_types|tcp_nodelay|tcp_nopush|timer_resolution|try_files|types|types_hash_bucket_size|types_hash_max_size|underscores_in_headers|uninitialized_variable_warn|upstream|user|userid|userid_domain|userid_expires|userid_name|userid_p3p|userid_path|userid_service|valid_referers|variables_hash_bucket_size|variables_hash_max_size|worker_priority|worker_processes|worker_rlimit_core|worker_rlimit_nofile|working_directory|xml_entities|xslt_stylesheet|xslt_types)([[:space:]]|$)"
    # color brightgreen "(^|[[:space:]{;])(access_log|add_after_body|add_before_body|add_header|addition_types|aio|alias|allow|ancient_browser|ancient_browser_value|auth_basic|auth_basic_user_file|autoindex|autoindex_exact_size|autoindex_localtime|break|charset|charset_map|charset_types|chunked_transfer_encoding|client_body_buffer_size|client_body_in_file_only|client_body_in_single_buffer|client_body_temp_path|client_body_timeout|client_header_buffer_size|client_header_timeout|client_max_body_size|connection_pool_size|create_full_put_path|daemon|dav_access|dav_methods|default_type|deny|directio|directio_alignment|disable_symlinks|empty_gif|env|error_log|error_page|expires|fastcgi_buffer_size|fastcgi_buffers|fastcgi_busy_buffers_size|fastcgi_cache|fastcgi_cache_bypass|fastcgi_cache_key|fastcgi_cache_lock|fastcgi_cache_lock_timeout|fastcgi_cache_min_uses|fastcgi_cache_path|fastcgi_cache_use_stale|fastcgi_cache_valid|fastcgi_connect_timeout|fastcgi_hide_header|fastcgi_ignore_client_abort|fastcgi_ignore_headers|fastcgi_index|fastcgi_intercept_errors|fastcgi_keep_conn|fastcgi_max_temp_file_size|fastcgi_next_upstream|fastcgi_no_cache|fastcgi_param|fastcgi_pass|fastcgi_pass_header|fastcgi_read_timeout|fastcgi_send_timeout|fastcgi_split_path_info|fastcgi_store|fastcgi_store_access|fastcgi_temp_file_write_size|fastcgi_temp_path|flv|geo|geoip_city|geoip_country|gzip|gzip_buffers|gzip_comp_level|gzip_disable|gzip_http_version|gzip_min_length|gzip_proxied|gzip_static|gzip_types|gzip_vary|if|if_modified_since|ignore_invalid_headers|image_filter|image_filter_buffer|image_filter_jpeg_quality|image_filter_sharpen|image_filter_transparency|include|index|internal|ip_hash|keepalive|keepalive_disable|keepalive_requests|keepalive_timeout|large_client_header_buffers|limit_conn|limit_conn_log_level|limit_conn_zone|limit_except|limit_rate|limit_rate_after|limit_req|limit_req_log_level|limit_req_zone|limit_zone|lingering_close|lingering_time|lingering_timeout|listen|location|log_format|log_not_found|log_subrequest|map|map_hash_bucket_size|map_hash_max_size|master_process|max_ranges|memcached_buffer_size|memcached_connect_timeout|memcached_next_upstream|memcached_pass|memcached_read_timeout|memcached_send_timeout|merge_slashes|min_delete_depth|modern_browser|modern_browser_value|mp4|mp4_buffer_size|mp4_max_buffer_size|msie_padding|msie_refresh|open_file_cache|open_file_cache_errors|open_file_cache_min_uses|open_file_cache_valid|open_log_file_cache|optimize_server_names|override_charset|pcre_jit|perl|perl_modules|perl_require|perl_set|pid|port_in_redirect|postpone_output|proxy_buffer_size|proxy_buffering|proxy_buffers|proxy_busy_buffers_size|proxy_cache|proxy_cache_bypass|proxy_cache_key|proxy_cache_lock|proxy_cache_lock_timeout|proxy_cache_min_uses|proxy_cache_path|proxy_cache_use_stale|proxy_cache_valid|proxy_connect_timeout|proxy_cookie_domain|proxy_cookie_path|proxy_hide_header|proxy_http_version|proxy_ignore_client_abort|proxy_ignore_headers|proxy_intercept_errors|proxy_max_temp_file_size|proxy_next_upstream|proxy_no_cache|proxy_pass|proxy_pass_header|proxy_read_timeout|proxy_redirect|proxy_send_timeout|proxy_set_header|proxy_ssl_session_reuse|proxy_store|proxy_store_access|proxy_temp_file_write_size|proxy_temp_path|random_index|read_ahead|real_ip_header|recursive_error_pages|request_pool_size|reset_timedout_connection|resolver|resolver_timeout|return|rewrite|root|satisfy|satisfy_any|secure_link_secret|send_lowat|send_timeout|sendfile|sendfile_max_chunk|server|server|server_name|server_name_in_redirect|server_names_hash_bucket_size|server_names_hash_max_size|server_tokens|set|set_real_ip_from|source_charset|split_clients|ssi|ssi_silent_errors|ssi_types|ssl|ssl_certificate|ssl_certificate_key|ssl_ciphers|ssl_client_certificate|ssl_crl|ssl_dhparam|ssl_engine|ssl_prefer_server_ciphers|ssl_protocols|ssl_session_cache|ssl_session_timeout|ssl_verify_client|ssl_verify_depth|sub_filter|sub_filter_once|sub_filter_types|tcp_nodelay|tcp_nopush|timer_resolution|try_files|types|types_hash_bucket_size|types_hash_max_size|underscores_in_headers|uninitialized_variable_warn|upstream|user|userid|userid_domain|userid_expires|userid_name|userid_p3p|userid_path|userid_service|valid_referers|variables_hash_bucket_size|variables_hash_max_size|worker_priority|worker_processes|worker_rlimit_core|worker_rlimit_nofile|working_directory|xml_entities|xslt_stylesheet|xslt_types)([[:space:]]|$)"
    color white "[{}]"
    color brightcyan "\<(on|off)\>"
    color brightyellow "\$[A-Za-z][A-Za-z0-9_]*"
    color red "[*]"
    color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
    color yellow start="'$" end="';$"
    color cyan "(^|[[:space:]])#([^{].*)?$"
    color ,green "[[:space:]]+$"
    color brightcyan start="\/var\/log\/nginx\/" end=";$"
    #color ,red " + +| + +"
    # +EXTRALINT



    ## HAProxy
    ##
    syntax "haproxy" "(haproxy|wildcard|exchange)\.cfg$" "\/etc\/haproxy\/*\.cfg$"
    color brightgreen "[A-Z0-9a-z_.,]{1,50}"
    color ,red "(\+|\$|\&)"
    color ,green "(\%|\!|\\)"
    color ,blue "(/)?(\:|\;|\{|\}|\[|\])"
    color black,cyan "[[:space:]]+is+\_([a-z]{1,}+\_+[a-z]{1,}+\_+[a-z]{1,}|[a-z]{1,}+\_+[a-z]{1,}|[a-z]{1,})"
    color brightred " ([0-9]{1,}[a-z]{1,}|[0-9]{1,})"
    color magenta "\<(emerg|alert|crit|err|warning|notice|info|debug|local[0-9]{1})\>"
    color black,blue "(if|\-i)"
    color brightred "\<(http|tcp|type|len|size|expire|global)\>"
    color green "\<( accept|code|redirect|bind|mode|(http|tcp)+\-+(check|request|response))|stick(|\-table)|user(|s)|group|chroot|(ca|crt)-base|ssl-default-bind-(options|ciphers)|option|description|log-format|balance|timeout|log|errorfile|level|socket)\>"
    color green "\<(tune\.[a-z]{1,}(|\.[a-z]{1,}(\-[a-z]{1,}|)(\-[a-z]{1,}|)))\>"
    color brightcyan "hdr_(end|dom)\(host\)"
    color yellow "\<(http-tunnel|auth|realm|httpclose|abortonclose|ssl-hello-chk|store-response|(server|client)hello|prefer-last-server|forwardfor|http-keep-alive|httpchk|tcpka|socket-stats|roundrobin|send-binary|http-send-name-header|maxconn|check|header|(|insecure\-)password|tcplog|inspect-delay|admin)\>"
    color yellow "\<(server|client|connect|httplog|log-separate-errors|dontlognull|content)\>"
    color brightcyan "\<(acl|use_backend|default_backend|expect|accept|stats|daemon|port|scheme)\>"
    color red "(/)?(2[0-5]{2}|1[0-9]{2}|[1-9][0-9]|[1-9])(\.(2[0-5]{2}|1[0-9]{2}|[1-9][0-9]|[0-9])){3}([[:space:]]+::(2[0-5]{2}|1[0-9]{2}|[1-9][0-9]|[0-9])/(2[0-5]{2}|1[0-9]{2}|[1-9][0-9]|[0-9]))?"
    color red "(/)?\:([0-9]{2}|[0-9]{1,5})"
    color ,blue start="^( |)(global|defaults|frontend|backend|listen|userlist)" end="$"
    color brightblack "[[:space:]]"
    color ,red "\<^( |)(global|defaults|frontend|backend|listen|userlist)\>"
    color ,magenta "(/[/\[\^#A-Za-z0-9\.\*\_\-]+)+"
    color cyan "(^|[[:space:]])#([^{].*)?$"
    color red "(\/+[1-9]{1,2})\>"
    color brightcyan "\<(req_ssl_sni|src|req_ssl_hello_type|HEAD|HTTP\/1\.0|Host|X-Real-IP|payload_lv|binary)\>"
    color brightcyan "\<(http(s|)\:\/\/[a-z0-9\_\.\=\-\&\?\/]{1,})\>"
    #######################################################




    ## Apache httpd.conf
    ##
    #how to add sites-enabled files? "default" is too generic to keep in here I think
    syntax "Apache2" "httpd.conf$"
    color brightwhite "(ServerRoot|LoadModule|(Lock|Pid)File|Timeout|(Max)?KeepAlive(Requests|Timeout)?)"
    color brightwhite "(User|Group|LogFormat|ErrorLog|Include|(Script)?Alias)"
    color brightwhite "(ErrorDocument|AccessFileName|UseCanonicalName|TypesConfig|DefaultType)"
    color brightwhite "(HostnameLookups|IndexOptions|(Readme|Header)Name|LanguagePriority)"
    color brightwhite "(AddIcon(ByEncoding|ByType)?|DefaultIcon|IndexIgnore|BrowserMatch)"
    color brightwhite "(Add(Encoding|Language|(Default)?Charset|Type|Handler)|DirectoryIndex)"
    color brightwhite "(DocumentRoot|Server(Admin|Signature)|LogLevel|CustomLog)"
    color brightwhite "((Force)?LanguagePriority|NameVirtualHost)"
    color brightyellow "(SetHandler|Order|Deny|Allow|SetOutputFilter)"
    color yellow "(AllowOverride|FileInfo|AuthConfig|Limit)"
    color yellow "([^A-Z0-9a-z]Options|Indexes|(\+|\-)?SymLinksIfOwnerMatch)"
    color yellow "(Includes(NoExec)?|(\+|\-)?MultiViews)"
    color yellow "(None|allow,deny|deny,allow|(allow)? from (all)?|Prefer|Fallback)"
    color yellow "(Add(Handler|OutputFilter)|NumServers|AcceptMutex)"
    color yellow "((Min|Max)Spare(Threads|Servers|Processors)|Start(Threads|Servers))"
    color yellow "(MaxClients|(Min|Max)?ThreadsPerChild|MaxRequestsPerChild)"
    color yellow "(FancyIndexing|VersionSort|ExecCGI|FollowSymLinks|(Min|Max)Processors)"
    color yellow "hostmaster@[A-Za-z0-9\.]*"
    color brightred "(On|Off)[[:space:]]*$"
    color brightred "[[:space:]]+(debug|info|notice|warn|error|crit|alert|emerg)[[:space:]]*$"
    color brightred "[[:space:]]+(combined|common|referer|agent)[[:space:]]*$"
    color brightred "[[:space:]]+(redirect\-carefully|nokeepalive)[[:space:]]*"
    color brightred "[[:space:]]+(force\-response\-1\.0)[[:space:]]*"
    color brightred "[[:space:]]+(downgrade\-1\.0)[[:space:]]*"
    color brightred "[[:space:]]+application/[a-zA-Z\-]+[[:space:]]*"
    color brightred "[[:space:]]+type-map[[:space:]]*"
    color magenta "[[:space:]]+[0-9]+[[:space:]]*"
    color magenta "(/)?(2[0-5]{2}|1[0-9]{2}|[1-9][0-9]|[1-9])(\.(2[0-5]{2}|1[0-9]{2}|[1-9][0-9]|[0-9])){3}([[:space:]]+::(2[0-5]{2}|1[0-9]{2}|[1-9][0-9]|[0-9])/(2[0-5]{2}|1[0-9]{2}|[1-9][0-9]|[0-9]))?"
    color brightcyan start="<" end=">"
    color white ""(\\.|[^\"])*""
    # Unix-based paths
    # can't use \] in the regex for some reason?!? Maybe a bug?
    # this is preventing a 100% "to the end of the line" match for a few
    # lines (the trailing characters from ] to the EOL are not highlighted.
    # if anyone knows how to make it work, let me know.. ;)
    color white "[[:space:]]+(/[/\[\^#A-Za-z0-9\.\*\_\-]+)+"
    color green "^[[:space:]]*#.*"
    color cyan "\<(ServerName|Serveralias|DocumentRoot|DirectoryIndex|ErrorLog|CustomLog)\>"




    ## git
    ##
    syntax "gitconfig" "git(config|modules)$|\.git/config$"
    color brightcyan "\<(true|false)\>"
    color brightcyan "^[[:space:]]*[^=]*="
    color brightmagenta "^[[:space:]]*\[.*\]$"
    color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
    color cyan "(^|[[:space:]])#([^{].*)?$"
    color ,green "[[:space:]]+$"
    color ,red " + +| + +"
    # +EXTRALINT
    ##
    syntax "git-editmsg" "(COMMIT|TAG)_EDITMSG$"
    color cyan "^#.*$"
    color ,red "[[:space:]]+$"
    ##
    syntax "git-rebase" "git-rebase-todo$"
    color brightcyan "^(edit|fixup|pick|reword|squash|exec|[efprsx])\>"
    color brightcyan "\<[0-9a-f]{7,40}\>"
    color cyan "^#.*"




    ## sql
    ##
    syntax "sql" "\.sql$" "sqliterc$"
    icolor brightcyan "\<(ALL|ASC|AS|ALTER|AND|ADD|AUTO_INCREMENT)\>"
    icolor brightcyan "\<(BETWEEN|BINARY|BOTH|BY|BOOLEAN)\>"
    icolor brightcyan "\<(CHANGE|CHECK|COLUMNS|COLUMN|CROSS|CREATE)\>"
    icolor brightcyan "\<(DATABASES|DATABASE|DATA|DELAYED|DESCRIBE|DESC|DISTINCT|DELETE|DROP|DEFAULT)\>"
    icolor brightcyan "\<(ENCLOSED|ESCAPED|EXISTS|EXPLAIN)\>"
    icolor brightcyan "\<(FIELDS|FIELD|FLUSH|FOR|FOREIGN|FUNCTION|FROM)\>"
    icolor brightcyan "\<(GROUP|GRANT|HAVING)\>"
    icolor brightcyan "\<(IGNORE|INDEX|INFILE|INSERT|INNER|INTO|IDENTIFIED|IN|IS|IF)\>"
    icolor brightcyan "\<(JOIN|KEYS|KILL|KEY)\>"
    icolor brightcyan "\<(LEADING|LIKE|LIMIT|LINES|LOAD|LOCAL|LOCK|LOW_PRIORITY|LEFT|LANGUAGE)\>"
    icolor brightcyan "\<(MODIFY|NATURAL|NOT|NULL|NEXTVAL)\>"
    icolor brightcyan "\<(OPTIMIZE|OPTION|OPTIONALLY|ORDER|OUTFILE|OR|OUTER|ON)\>"
    icolor brightcyan "\<(PROCEDURE|PROCEDURAL|PRIMARY)\>"
    icolor brightcyan "\<(READ|REFERENCES|REGEXP|RENAME|REPLACE|RETURN|REVOKE|RLIKE|RIGHT)\>"
    icolor brightcyan "\<(SHOW|SONAME|STATUS|STRAIGHT_JOIN|SELECT|SETVAL|SET)\>"
    icolor brightcyan "\<(TABLES|TERMINATED|TO|TRAILING|TRUNCATE|TABLE|TEMPORARY|TRIGGER|TRUSTED)\>"
    icolor brightcyan "\<(UNIQUE|UNLOCK|USE|USING|UPDATE|VALUES|VARIABLES|VIEW)\>"
    icolor brightcyan "\<(WITH|WRITE|WHERE|ZEROFILL|TYPE|XOR)\>"
    color green "\<(VARCHAR|TINYINT|TEXT|DATE|SMALLINT|MEDIUMINT|INT|INTEGER|BIGINT|FLOAT|DOUBLE|DECIMAL|DATETIME|TIMESTAMP|TIME|YEAR|UNSIGNED|CHAR|TINYBLOB|TINYTEXT|BLOB|MEDIUMBLOB|MEDIUMTEXT|LONGBLOB|LONGTEXT|ENUM|BOOL|BINARY|VARBINARY)\>"

    ## SQLite meta commands
    ##
    icolor brightcyan "\.\<(databases|dump|echo|exit|explain|header(s)?|help)\>"
    icolor brightcyan "\.\<(import|indices|mode|nullvalue|output|prompt|quit|read)\>"
    icolor brightcyan "\.\<(schema|separator|show|tables|timeout|width)\>"
    color brightcyan "\<(ON|OFF)\>"
    color brightcyan "\<([0-9]+)\>"
    color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
    color yellow "`(\\.|[^\\`])*`"
    color cyan "\-\-.*$"
    color ,green "[[:space:]]+$"
    color ,red " + +| + +"
    # +EXTRALINT



    ## makefile
    ##
    syntax "makefile" "([Mm]akefile|\.ma?k)$"
    header "^#!.*/(env +)?[bg]?make( |$)"
    color brightcyan "\<(ifeq|ifdef|ifneq|ifndef|else|endif)\>"
    color brightcyan "^(export|include|override)\>"
    color brightmagenta "^[^:= ]+:"
    color red "[=,%]" "\+=|\?=|:=|&&|\|\|"
    color brightcyan "\$\((abspath|addprefix|addsuffix|and|basename|call|dir)[[:space:]]"
    color brightcyan "\$\((error|eval|filter|filter-out|findstring|firstword)[[:space:]]"
    color brightcyan "\$\((flavor|foreach|if|info|join|lastword|notdir|or)[[:space:]]"
    color brightcyan "\$\((origin|patsubst|realpath|shell|sort|strip|suffix)[[:space:]]"
    color brightcyan "\$\((value|warning|wildcard|word|wordlist|words)[[:space:]]"
    color cyan "[()$]"
    color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
    color brightyellow "\$+(\{[^} ]+\}|\([^) ]+\))"
    color brightyellow "\$[@^<*?%|+]|\$\([@^<*?%+-][DF]\)"
    color magenta "\$\$|\\.?"
    color cyan "(^|[[:space:]])#([^{].*)?$"
    color cyan "^ @#.*"

    # Show trailing whitespace
    color ,green "[[:space:]]+$"



    ## yaml
    ##
    syntax "yaml" "\.ya?ml$"
    header "^---" "%YAML"
    color green "(^| )!!(binary|bool|float|int|map|null|omap|seq|set|str) "
    color brightcyan "\<(YES|yes|Y|y|ON|on|NO|no|N|n|OFF|off)\>"
    color brightcyan "\<(true|false)\>"
    color red ":[[:space:]]" "\[" "\]" ":[[:space:]]+[|>]" "^[[:space:]]*- "
    color brightyellow "[[:space:]][\*&][A-Za-z0-9]+"
    color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
    color cyan "(^|[[:space:]])#([^{].*)?$"
    color brightmagenta "^---" "^\.\.\." "^%YAML" "^%TAG"
    color ,green "[[:space:]]+$"
    color ,red " + +| + +"
    # +EXTRALINT



    ## markdown
    ##
    syntax "markdown" "\.(md|mkd|mkdn|markdown)$"
    color green "(^|[[:space:]])(_[^ ][^_]*_|\*[^ ][^*]*\*)"
    color brightgreen "(^|[[:space:]])(__[^ ][^_]*__|\*\*[^ ][^*]*\*\*)"
    color brightmagenta "^=====*$|^-----*$|^#{1,6}.*"
    color brightcyan "^[[:space:]]*[\*+-] |^[[:space:]]*[0-9]+\. "
    color cyan "^[[:space:]]+"
    color magenta "\(([CcRr]|[Tt][Mm])\)" "\.{3}" "(^|[[:space:]])\-\-($|[[:space:]])"
    color brightyellow "\!?\[[^]]*\]([[:space:]]*\[[^]]*\]|\(.*\))?"
    color brightyellow "^\[.*\]:[[:space:]]*[^"]*"
    color yellow "`[^`]*`|^ {4}[^-+*].*"
    color cyan "^>.*"
    color ,green "[[:space:]]+$"
    color ,red " + +| + +"
    # +EXTRALINT



    ## json
    ##
    syntax "json" "\.json$"
    header "^\{$"
    color brightcyan "\<[-]?[1-9][0-9]*([Ee][+-]?[0-9]+)?\>" "\<[-]?[0](\.[0-9]+)?\>"
    color brightcyan "\<null\>"
    color brightcyan "\<(true|false)\>"
    color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
    color brightyellow "\"(\\"|[^"])*\"[[:space:]]*:" "'(\'|[^'])*'[[:space:]]*:"
    color magenta "\\u[0-9a-fA-F]{4}|\\[bfnrt'"/\\]"
    color ,green "[[:space:]]+$"
    color ,red " + +| + +"
    # +EXTRALINT



    ## xml
    ##
    syntax "xml" "\.([jrs]html?|sgml?|xml|opml|xslt?|plist)$"
    header "<\?xml"
    color brightmagenta start="<" end=">"
    color brightcyan " [a-z_-]+="
    color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
    color brightwhite,red "&"
    color magenta "&(#[0-9]+|#x[0-9a-fA-F]+|[A-Za-z][A-Za-z0-9]*);"
    color cyan start="<!--" end="-->"
    color cyan start="<!DOCTYPE" end=">"
    color ,green "[[:space:]]+$"
    color ,red " + +| + +"
    # +EXTRALINT



    ## apt/sources.list
    ##
    syntax "apt" "sources\.list(\.old|~)?$"
    color brightmagenta "^deb(-src)? ((http|file|ftp):/[^ ]+|cdrom:\[[^\]]+\]/|cdrom:\[[-a-zA-Z0-9\._\(\) ]+\]/) [^ ]+ .+$"
    color brightred "^deb(-src)? ((http|file|ftp):/[^ ]+|cdrom:\[[^\]]+\]/|cdrom:\[[-a-zA-Z0-9\._\(\) ]+\]/) [^ ]+"
    color brightgreen "(http|file|ftp):/[^ ]+"
    # [^\]] does not work...
    color brightgreen "cdrom:\[[-a-zA-Z0-9\._\(\) ]+\]/"
    color yellow "^deb"
    color yellow "^deb-src"
    color brightcyan "#.*"


    ## go
    ##
    syntax "go" "\.go$"
    color brightcyan "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]"
    color cyan "[(]"
    color brightcyan "\<(append|cap|close|complex|copy|delete|imag|len)\>"
    color brightcyan "\<(make|new|panic|print|println|protect|real|recover)\>"
    color green "\<(u?int(8|16|32|64)?|float(32|64)|complex(64|128))\>"
    color green "\<(uintptr|byte|rune|string|interface|bool|map|chan|error)\>"
    color brightcyan "\<(package|import|const|var|type|struct|func|go|defer|nil|iota)\>"
    color brightcyan "\<(for|range|if|else|case|default|switch|return)\>"
    color brightred "\<(go|goto|break|continue)\>"
    color brightcyan "\<(true|false)\>"
    color red "[-+/*=<>!~%&|^]|:="
    color brightcyan "\<([0-9]+|0x[0-9a-fA-F]*)\>|'.'"
    color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
    color magenta "\\[abfnrtv'\"\\]"
    color magenta "\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
    color yellow "`[^`]*`"
    color cyan "(^|[[:space:]])//.*"
    color cyan start="/\*" end="\*/"
    color brightwhite,cyan "TODO:?"
    color ,green "[[:space:]]+$"
    color ,red " + +| + +"
    # +EXTRALINT



    ## html
    ##
    syntax "html" "\.html?$"
    header "<!doctype html"
    header "<html"
    color magenta "\<(accept|accept-charset|accesskey|action|alt|async|autocomplete|autofocus|autoplay|border|challenge|charset|checked|cite|class|cols|colspan|content|contenteditable|contextmenu|controls|coords|crossorigin|data-[a-z-]+|datetime|default|defer|dir|dirname|disabled|draggable|dropzone|enctype|for|form|formaction|formenctype|formmethod|formnovalidate|formtarget|headers|height|hidden|high|href|hreflang|http-equiv|icon|id|ismap|keytype|kind|label|lang|list|loop|low|manifest|max|maxlength|media|mediagroup|method|min|multiple|muted|name|novalidate|open|optimum|pattern|placeholder|poster|preload|pubdate|radiogroup|readonly|rel|required|reversed|rows|rowspan|sandbox|spellcheck|scope|scoped|seamless|selected|shape|size|sizes|span|src|srcdoc|srclang|start|step|style|tabindex|target|title|type|typemustmatch|usemap|value|width|wrap)\>"
    color brightwhite,red "</?[A-Za-z0-9_]+[ >]"
    color brightmagenta "</?(a|abbr|address|area|article|aside|audio|b|base|bdo|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|command|datalist|dd|del|details|dfn|div|dl|dt|em|embed|eventsource|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|keygen|label|legend|li|link|mark|map|menu|meta|meter|nav|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|ruby|rp|rt|samp|script|section|select|small|source|span|strong|style|sub|summary|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|ul|var|video|wbr)[ >]"
    color yellow "=([A-Za-z0-9!$%*\^(){}#|:;_~@+,.?/\\-]|\[|\])+"
    color red "="
    color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
    color cyan start=">" end="<"
    color brightmagenta "[<>]"
    # Embedded template languages
    color brightyellow "\{\{[^}]*\}\}|<%=.*%>"
    color brightcyan start="<\?" end="\?>"
    color brightcyan start="<%[^=]" end="%>"
    color brightcyan start="\{%" end="%\}"
    #
    color magenta "&(#[0-9]+|#x[0-9a-fA-F]+|[A-Za-z][A-Za-z0-9]*);"
    color cyan start="<!--" end="-->"
    color cyan "<!(doctype|DOCTYPE)[^>]*>"
    color ,green "[[:space:]]+$"
    color ,red " + +| + +"
    # +EXTRALINT



    ## ini
    ##
    syntax "ini" "\.(ini|desktop|lfl|override)$" "(mimeapps\.list|pinforc)$"
    header "^\[[A-Za-z]+\]$"
    color brightcyan "\<(true|false)\>"
    color brightcyan "^[[:space:]]*[^=]*="
    color brightmagenta "^[[:space:]]*\[.*\]$"
    color red "[=;]"
    color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
    color cyan "(^|[[:space:]])#([^{].*)?$"
    color ,green "[[:space:]]+$"
    color ,red " + +| + +"
    # +EXTRALINT



    ## inputrc
    ##
    syntax "inputrc" "inputrc$"
    color red "\<(off|none)\>"
    color green "\<on\>"
    color brightcyan "\<set|\$include\>"
    color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
    color magenta "\\.?"
    color cyan "(^|[[:space:]])#([^{].*)?$"
    color ,green "[[:space:]]+$"
    color ,red " + +| + +"
    # +EXTRALINT



    ## java
    ##
    syntax "java" "\.java$"
    color brightmagenta "class +[A-Za-z0-9]+ *((implements|extends) +[A-Za-z0-9.]+)?"
    color magenta "@[A-Za-z]+"
    color brightcyan "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]"
    color cyan "[(]"
    color green "\<(boolean|byte|char|double|float|int|long|short|String|void)\>"
    color brightcyan "\<(case|catch|default|do|else|finally|for|if)\>"
    color brightcyan "\<(new|return|switch|this|throw|transient|try|while)\>"
    color brightcyan "\<(abstract|class|extends|final|implements|import|instanceof)\>"
    color brightcyan "\<(interface|native|package|private|protected|public|static)\>"
    color brightcyan "\<(strictfp|super|synchronized|throws|volatile|null)\>"
    color brightred "\<(break|continue)\>"
    color brightcyan "\<(true|false)\>"
    color red "[-+/*=<>?:!~%&|]"
    color brightcyan "\<([0-9._]+|0x[A-Fa-f0-9_]+|0b[0-1_]+)[FL]?\>"
    color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
    color magenta "\\([btnfr]|'|\"|\\)"
    color magenta "\\u[A-Fa-f0-9]{4}"
    color cyan "(^|[[:space:]])//.*"
    color cyan start="/\*" end="\*/"
    color brightwhite,cyan "TODO:?"
    color ,green "[[:space:]]+$"
    color ,red " + +| + +"
    # +EXTRALINT



    ## javascript
    ##
    syntax "JavaScript" "\.js$"
    color brightcyan "\<[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\>"
    color brightcyan "\<[-+]?([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?"
    color brightcyan "\<[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?"
    color brightcyan "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]"
    color cyan "[(]"
    color brightcyan "\<(break|case|catch|continue|default|delete|do|else|finally)\>"
    color brightcyan "\<(for|function|get|if|in|instanceof|new|return|set|switch)\>"
    color brightcyan "\<(switch|this|throw|try|typeof|var|void|while|with)\>"
    color brightcyan "\<(null|undefined|NaN)\>"
    color brightcyan "\<(true|false)\>"
    color green "\<(Array|Boolean|Date|Enumerator|Error|Function|Math)\>"
    color green "\<(Number|Object|RegExp|String)\>"
    color red "[-+/*=<>!~%?:&|]"
    color magenta "/[^*]([^/]|(\\/))*[^\\]/[gim]*"
    color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
    color magenta "\\[0-7][0-7]?[0-7]?|\\x[0-9a-fA-F]+|\\[bfnrt'"\?\\]"
    color cyan "(^|[[:space:]])//.*"
    color cyan start="/\*" end="\*/"
    color brightwhite,cyan "TODO:?"
    color ,green "[[:space:]]+$"
    color ,red " + +| + +"
    # +EXTRALINT



    ## lua
    ##
    syntax "lua" "\.lua$"
    header "^#!.*lua(jit)?$"
    color brightcyan "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*([({'"]|\[=*\[)"
    color brightcyan "\<(do|end|while|repeat|until|if|elseif|then|else)\>"
    color brightcyan "\<(for|in|function|local|return|nil)\>"
    color brightred "\<(goto|break)\>"
    color brightcyan "\<(true|false)\>"
    color red "[-+:*/%^=#<>]|~=|\.\.|\[|\]|\<(not|and|or)\>"
    color brightwhite,red "[`!@$&|?]|!="
    color cyan "\.{3,}|[({'"]"
    color brightcyan "\<([0-9]+)(\.[0-9]+)?([Ee][+-]?[0-9]+)?\>|0x[0-9a-fA-F]*"
    color brightmagenta "::[A-Za-z_][A-Za-z0-9_]*::"
    color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
    color magenta "\\([0-9]{1,3}|x[A-Fa-f0-9]{2}|[abefntrv'"\\]|\[|\])"
    color yellow start="\[\[" end="\]\]"
    color yellow start="\[=\[" end="\]=\]"
    color yellow start="\[==\[" end="\]==\]"
    color cyan "^#!.*" "(^|[[:space:]])\-\-.*$"
    color cyan start="\-\-\[\[" end="\]\]"
    color brightwhite,cyan "TODO:?"
    color ,green "[[:space:]]+$"
    color ,red " + +| + +"
    # +EXTRALINT



    ## man
    ##
    syntax "man" "\.[1-9]x?$"
    color brightmagenta "\.(S|T)H.*$"
    color brightcyan "\.(BR?|I[PR]?).*$"
    color brightyellow "\.(S|T)H|\.TP|\.(BR?|I[PR]?|PP)|\\f[BIPR]"
    color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
    color yellow "\.(br|DS|RS|RE|PD)"
    color ,green "[[:space:]]+$"
    color ,red " + +| + +"
    # +EXTRALINT



    ## php
    ##
    syntax "php" "\.php[2345s~]?$"
    header "^(//|/\*).*[Pp][Hh][Pp]|<\?php\>"
    color red "[-+/*=<>?:!~%&|]"
    color brightmagenta "(<\?(php)?|\?>)"
    color brightcyan "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]"
    color cyan "[(]"
    color green "\<(float|global|double|bool|char|int|enum|const)\>"
    color brightcyan "\<(class|new|private|public|function|for|foreach|if|while|do|var)\>"
    color brightcyan "\<(return|else|elseif|case|default|switch)\>"
    color brightred "\<(goto|break|continue)\>"
    color brightcyan "\<(true|false)\>"
    color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
    color brightyellow "\$[A-Za-z_][A-Za-z0-9_]*"
    color cyan "(^|[[:space:]])//.*"
    color cyan start="/\*" end="\*/"
    color brightwhite,cyan "TODO:?"
    color ,green "[[:space:]]+$"
    color ,red " + +| + +"
    # +EXTRALINT



    ## pkgbuild
    ##
    syntax "pkgbuild" "PKGBUILD$" "\.install$"
    color brightcyan "^[A-Za-z0-9_+-]+[[:space:]]*\(\)"
    color brightcyan "\<(case|do|done|elif|else|esac|fi|for|function|if)\>"
    color brightcyan "\<(in|select|then|time|until|while)\>"
    color brightcyan "\<(echo|exit|export|let|local|read|return|set|shift|umask|unset)\>"
    color green "\<(pkgname|pkgver|pkgrel|epoch|pkgdesc|arch|url|license)\>"
    color green "\<(groups|depends|makedepends|checkdepends|optdepends)\>"
    color green "\<(provides|conflicts|replaces|backup|options|^install)\>"
    color green "\<(changelog|source|noextract)\>"
    color green "\<(md5sums|sha1sums|sha256sums|sha384sums|sha512sums)\>"
    color green "\<(srcdir|pkgdir)\>"
    color brightyellow "\<(strip|docs|libtool|emptydirs|zipman|purge|upx)\>"
    color brightyellow "\<(ccache|distcc|buildflags|makeflags)\>"
    color red "[{}()<>!=&|;`$]|\\|\[|\]|-(eq|ne|gt|lt|ge|le|s|n|z)\>"
    color yellow ""(\\.|[^"])*""
    color brightyellow "\$\{?[A-Za-z0-9_!@#$*?-]+\}?|`[^`]*`"
    color yellow "'(\\.|[^'])*'"
    color magenta "\\.?"
    color cyan "(^|[[:space:]])#([^{].*)?$"
    color ,green "[[:space:]]+$"
    color ,red " + +| + +"
    # +EXTRALINT



    ## pkg-config
    ##
    syntax "pkg-config" "\.pc$"
    color brightcyan "^(Name|Description|URL|Version|Conflicts|Cflags):"
    color brightcyan "^(Requires|Libs)(\.private)?:"
    color red "="
    color brightyellow "\$\{[A-Za-z_][A-Za-z0-9_]*\}"
    color ,green "[[:space:]]+$"
    color ,red " + +| + +"
    # +EXTRALINT



    ## properties
    ##
    syntax "properties" "\.properties$"
    color brightcyan "^[[:space:]]*[^#!]([^:= ]|\\[:= ])*[:= ]"
    color red "[:=]"
    color magenta "\\([#!=: ]|$)"
    color magenta "\\u[[:xdigit:]]{4}"
    color cyan "^[[:space:]]*[#!].*$"
    color ,green "[[:space:]]+$"
    color ,red " + +| + +"
    # +EXTRALINT



    ## python
    ##
    syntax "python" "\.py$" "jhbuildrc$"
    header "^#!.*/(env +)?python[-0-9._]*( |$)"
    color brightcyan "\<(as|assert|break|class|continue|def|del|elif|else|except)\>"
    color brightcyan "\<(exec|finally|for|from|global|if|import|lambda)\>"
    color brightcyan "\<(pass|print|raise|return|try|while|with|yield|None)\>"
    color brightcyan "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]"
    color cyan "[(]"
    color red "[-+*/|=%<>&~^]|\<(and|not|or|is|in)\>"
    color brightyellow "@[A-Za-z0-9_]+"
    color brightmagenta "__[A-Za-z0-9_]+__"
    color brightcyan "\<(True|False)\>"
    color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
    color yellow "['][^']*[^\\][']" "[']{3}.*[^\\][']{3}"
    color yellow "["][^"]*[^\\]["]" "["]{3}.*[^\\]["]{3}"
    color yellow start=""""[^"]" end="""""
    color yellow start="'''[^']" end="'''"
    color magenta "\\.?"
    color cyan "(^|[[:space:]])#([^{].*)?$"
    color brightwhite,cyan "TODO:?"
    color ,green "[[:space:]]+$"
    color ,red " + +| + +"
    # +EXTRALINT

    ## Ruby
    ##
    syntax "ruby" "\.rb$|Rakefile$" "Vagrantfile" "Vagrantfile[^/]*$"
    color brightwhite "\<(BEGIN|END|alias|and|begin|break|case|class|def|defined\?|do|else|elsif|end|ensure|false|for|if|in|module|next|nil|not|or|redo|rescue|retry|return|self|super|then|true|undef|unless|until|when|while|yield)\>"
    color yellow "(^|[[:space:]]):[A-Za-z0-9_]+\>"
    color magenta "/([^/]|(\\/))*/[iomx]*" "%r\{([^}]|(\\}))*\}[iomx]*"
    color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
    color cyan "(^|[[:space:]])#([^{].*)?$"
    color cyan start="^=begin$" end="^=end$"
    color brightwhite,cyan "TODO:?"
    color ,green "[[:space:]]+$"
    color ,red " + +| + +"
    # +EXTRALINT


    ## sed
    ##
    syntax "sed" "\.sed$"
    header "^#!.*bin/(env +)?sed( |$)"
    color red "[|^$.*+]"
    color brightyellow "\{[0-9]+,?[0-9]*\}"
    color magenta "\\."
    color cyan "(^|[[:space:]])#([^{].*)?$"
    color ,green "[[:space:]]+$"
    color ,red " + +| + +"
    # +EXTRALINT



    ## nanorc
    ##
    syntax "nanorc" "\.?nanorc$" "nanorc$" "\.?nano_syntax$"
    icolor brightwhite "^[[:space:]]*((un)?set|include|syntax|i?color).*$"
    icolor brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(allow_insecure_backup|autoindent|backup|backupdir|backwards|boldtext|brackets|casesensitive|const|cut|fill|historylog|matchbrackets|morespace|mouse|multibuffer|noconvert|nofollow|nohelp|nonewlines|nowrap|operatingdir|preserve|punct)\>" "^[[:space:]]*(set|unset)[[:space:]]+(quickblank|quotestr|rebinddelete|rebindkeypad|regexp|smarthome|smooth|softwrap|speller|suspend|suspendenable|tabsize|tabstospaces|tempfile|undo|view|whitespace|wordbounds)\>"
    icolor green "^[[:space:]]*(set|unset|include|syntax|header)\>"
    icolor yellow "^[[:space:]]*i?color[[:space:]]*(bright)?(white|black|red|blue|green|yellow|magenta|cyan)?(,(white|black|red|blue|green|yellow|magenta|cyan))?\>"
    icolor magenta "^[[:space:]]*i?color\>" "\<(start|end)="
    icolor white ""(\\.|[^"])*""
    icolor brightcyan "^[[:space:]]*#.*$"
    icolor cyan "^[[:space:]]*##.*$"




    ## Dockerfile
    syntax "Dockerfile" "Dockerfile[^/]*$"
    color brightcyan "[A-Z][A-Z_0-9]{1,}"
    icolor ,red "CMD"
    icolor black,red "^(RUN|CMD|LABEL|EXPOSE|ENV|ARG|ADD|COPY|ENTRYPOINT|VOLUME|USER|WORKDIR|ONBUILD|HEALTHCHECK|SHELL)"
    icolor cyan "^(MAINTAINER)[[:space:]]"
    icolor black,yellow "^(FROM|AS)"
    color brightgreen "(\(|\)|\[|\])"
    color brightmagenta "(&&|\\)"
    icolor cyan "^[[:space:]]*#.*$"
    color ,green "[[:space:]]+$"
    color brightwhite "'([^']|(\\'))*'" "%[qw]\{[^}]*\}" "%[qw]\([^)]*\)" "%[qw]<[^>]*>" "%[qw]\[[^]]*\]" "%[qw]\$[^$]*\$" "%[qw]\^[^^]*\^" "%[qw]![^!]*!"
    color brightwhite ""([^"]|(\\"))*"" "%[QW]?\{[^}]*\}" "%[QW]?\([^)]*\)" "%[QW]?<[^>]*>" "%[QW]?\[[^]]*\]" "%[QW]?\$[^$]*\$" "%[QW]?\^[^^]*\^" "%[QW]?![^!]*!"
    color cyan "--chown=\w{2,}\:\w{2,}"
    color yellow "\$(\{(...+)\}|(\b|\B))"
    color brightyellow "('|\")"
    color brightgreen "="


    ## docker-compose
    syntax "docker-compose" "docker-compose*.(yml|yaml)$" "docker-compose\.(override|\w{3,})\.yml"
    color magenta "[A-Z][A-Z_0-9]{1,}"
    color green "\<[_a-z0-9-]{2,40}\>:$"
    color brightred "(: |- )[[:space:]]\\.+\\/\<[_a-z0-9-]{2,80}\>$"
    icolor red "^(version|networks|services|labels|volume_driver):$"
    color brightgreen "(^| )(volumes|ports|volumes_from|tty|expose|links|command|tmpfs|entrypoint|env_file|extends|extra_hosts|external_links|network_mode|aliases):*$"
    color brightred "(^| )(command|depends_on|healthcheck|test|restart):"
    color cyan "(^| )(cpu_shares|cpu_quota|cpuset|user|working_dir|domainname|hostname|ipc|mac_address|mem_limit|memswap_limit|mem_reservation|privileged|oom_score_adj|read_only|shm_size|stdin_open|tty):"
    color brightcyan "(^| )(image|build|context|dockerfile|external|driver|sysctls|ulimits|):*"
    color yellow "(^| )(bridge|external:|true|false|args:)"
    color brightcyan "(^| )(container_name):"
    color red ":[[:space:]]" "\[" "\]" ":[[:space:]]+[|>]" "^[[:space:]]*- "
    color brightyellow "[[:space:]][\*&][A-Za-z0-9]+"
    color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
    color cyan "(^|[[:space:]])#([^{].*)?$"
    color ,green "[[:space:]]+$"
    #color ,red " + +| + +| | | "
    color black,cyan "^version\:[[:space:]]('|\")(\d|[1-9]{1,3}|[1-9]\.[0-9]{1,3})('|\")"
    color brightcyan "(^| )environment\:"
    color brightyellow "('|\")"
    color brightgreen "="
    # color green "( | | | )([[::]]|*):$"
    # color brightmagenta "^---" "^\.\.\." "^%YAML" "^%TAG"


    ## ssh-config
    syntax "ssh" "\.ssh\/config$"
    color brightyellow "[A-Z0-9a-z_.,]{1,50}"
    color yellow "([0-9]{1,5})"
    color brightwhite "(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])"
    color brightwhite,blue start="\<Host\>" end="$"
    color white,black "[[:space:]]"
    color white,green "\<Host\>"
    color red,white "[*]{0,1}"
    color brightwhite,red "\<Host\>[[:space:]]\*$"
    color white,red "[+:]{0,1}"
    color red "<\(IdentityFile|PasswordAuthentication|StrictHostKeyChecking)\>" "\<(root|[oO]n|[oO]ff|[yY]es|[nN]o|[tT]rue|[fF]alse)\>"
    color brightcyan "\<(Hostname|User|Port|ProxyCommand|StrictHostKeyChecking|DynamicForward|HostName|SendEnv|AddressFamily|BatchMode|BindAddress|GatewayPorts|HostKeyAlias|LogLevel|TCPKeepAlive|UserKnownHostsFile|VisualHostKey)\>"
    color brightcyan "\<(ControlMaster|ControlPath|ControlPersist|ForwardAgent|HostbasedAuthentication|IdentitiesOnly|LocalCommand|LocalForward|PermitLocalCommand|PubkeyAuthentication)\>"
    color brightred start="\$\(" end="\)$"
    color cyan "#.*$"

    15 changes: 15 additions & 0 deletions nano-syntaxes.bash
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    #!/bin/bash
    S_FILE="/usr/share/nano/combined_syntax.nanorc"
    declare -a SYNTAXES
    SYNTAXES+=($(grep '^syntax' ${S_FILE} | awk '{print $2}' | tr -d '"' | sort -d))
    msg "There are ${#SYNTAXES[@]} syntax definitions for Nano in: ${S_FILE}"
    (
    echo "${SYNTAXES[@]:0:5}"
    echo "${SYNTAXES[@]:6:5}"
    echo "${SYNTAXES[@]:11:5}"
    echo "${SYNTAXES[@]:16:5}"
    echo "${SYNTAXES[@]:21:5}"
    echo "${SYNTAXES[@]:26:5}"
    echo "${SYNTAXES[@]:31:5}"
    echo "${SYNTAXES[@]:36:5}"
    ) | column -t