mirror of
https://github.com/scopatz/nanorc
synced 2025-06-20 05:30:08 +02:00
Begin the union of the nano's file with ours.
Note: these files will be deleted.
This commit is contained in:
parent
c0528f6361
commit
405a71cc65
25
original/asm.nanorc
Normal file
25
original/asm.nanorc
Normal file
@ -0,0 +1,25 @@
|
||||
## Here is an example for assembler.
|
||||
|
||||
syntax asm "\.(S|s|asm)$"
|
||||
magic "assembler source"
|
||||
comment "//"
|
||||
|
||||
color red "\<[A-Z_]{2,}\>"
|
||||
color brightgreen "\.(data|subsection|text)"
|
||||
color green "\.(align|file|globl|global|hidden|section|size|type|weak)"
|
||||
color brightyellow "\.(ascii|asciz|byte|double|float|hword|int|long|short|single|struct|word)"
|
||||
color brightred "^[[:space:]]*[.0-9A-Za-z_]*:"
|
||||
color brightcyan "^[[:space:]]*#[[:space:]]*(define|undef|include|ifn?def|endif|elif|else|if|warning|error)"
|
||||
|
||||
# Strings.
|
||||
color brightyellow "<[^= ]*>" ""(\\.|[^"])*""
|
||||
# Multiline strings. This regex is VERY resource intensive,
|
||||
# and sometimes colours things that shouldn't be coloured.
|
||||
###color brightyellow start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
|
||||
|
||||
# Comments.
|
||||
color brightblue "//.*"
|
||||
color brightblue start="/\*" end="\*/"
|
||||
|
||||
# Trailing whitespace.
|
||||
color ,green "[[:space:]]+$"
|
32
original/autoconf.nanorc
Normal file
32
original/autoconf.nanorc
Normal file
@ -0,0 +1,32 @@
|
||||
## Here is an example for Autoconf.
|
||||
|
||||
syntax autoconf "\.(ac|m4)$"
|
||||
comment "#"
|
||||
|
||||
# Keywords:
|
||||
color yellow "\<(if|test|then|elif|else|fi|for|in|do|done)\>"
|
||||
color yellow "(=|!=|&&|\|\|)"
|
||||
|
||||
# Macros:
|
||||
color cyan "\<[[:upper:]_[:digit:]]+\>"
|
||||
|
||||
# Version numbers:
|
||||
color red "\<[-_.0-9]+\>"
|
||||
|
||||
# Strings:
|
||||
color red "\"[^"]*\"" "\'[^']*\'"
|
||||
|
||||
# Backticks:
|
||||
color green "`[^`]*`"
|
||||
|
||||
# Error lines:
|
||||
color brightred "^[[:space:]]*\*\*\*.*"
|
||||
|
||||
# Brackets:
|
||||
color magenta "\[|\]|\(|\)"
|
||||
|
||||
# Comments:
|
||||
color blue "^[[:blank:]]*#.*" "\<dnl.*"
|
||||
|
||||
# Trailing whitespace:
|
||||
color ,green "[[:space:]]+$"
|
37
original/awk.nanorc
Normal file
37
original/awk.nanorc
Normal file
@ -0,0 +1,37 @@
|
||||
## Here is an example for awk.
|
||||
|
||||
syntax awk "\.awk$"
|
||||
header "^#!.*awk"
|
||||
magic "awk script"
|
||||
comment "#"
|
||||
|
||||
# Records.
|
||||
color brightred "\$[0-9A-Za-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|fflush|getline|next|nextfile|print|printf|system)\>"
|
||||
# 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)\>"
|
||||
|
||||
# Strings.
|
||||
color brightyellow "<[^= ]*>" ""(\\.|[^"])*""
|
||||
# Comments.
|
||||
color brightblue "(^|[[:space:]])#.*$"
|
||||
|
||||
# Trailing whitespace.
|
||||
color ,green "[[:space:]]+$"
|
42
original/c.nanorc
Normal file
42
original/c.nanorc
Normal file
@ -0,0 +1,42 @@
|
||||
## Here is an example for C/C++.
|
||||
|
||||
syntax c "\.([ch](pp|xx)?|C|cc|c\+\+|cu|H|hh|ii?)$"
|
||||
magic "^(C|C\+\+) (source|program)"
|
||||
comment "//"
|
||||
|
||||
# Constants.
|
||||
color brightred "\<[A-Z_][0-9A-Z_]+\>"
|
||||
# Labels.
|
||||
color brightmagenta "^[[:space:]]*[A-Z_a-z]+:[[:space:]]*$"
|
||||
|
||||
color green "\<(float|double|bool|char|int|short|long|sizeof|enum|void|auto|static|const|struct|union|typedef|extern|(un)?signed|inline)\>"
|
||||
color green "\<([[:lower:]][[:lower:]_]*|(u_?)?int(8|16|32|64))_t\>"
|
||||
color green "\<(class|namespace|template|public|protected|private|typename|this|friend|virtual|override|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 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)__"
|
||||
|
||||
# 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 ""([^"]|\\")*"" "#[[:space:]]*include[[:space:]]+<[^[:blank:]=]*>"
|
||||
# Multiline strings. This regex is VERY resource intensive,
|
||||
# and sometimes colours things that shouldn't be coloured.
|
||||
###color brightyellow start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
|
||||
|
||||
# Preprocessor directives.
|
||||
color brightcyan start="^[[:space:]]*#[[:space:]]*(if(n?def)?|elif|warning|error|pragma)\>" end="(\`|[^\\])$"
|
||||
color brightcyan "^[[:space:]]*#[[:space:]]*(define|else|endif|include(_next)?|undef)\>"
|
||||
|
||||
# Comments.
|
||||
color brightblue "//.*"
|
||||
color brightblue start="/\*" end="\*/"
|
||||
|
||||
# Reminders.
|
||||
color brightwhite,yellow "\<(FIXME|TODO|XXX)\>"
|
||||
|
||||
# Trailing whitespace.
|
||||
color ,green "[[:space:]]+$"
|
28
original/changelog.nanorc
Normal file
28
original/changelog.nanorc
Normal file
@ -0,0 +1,28 @@
|
||||
## Colouring for Changelogs.
|
||||
|
||||
syntax changelog "Change[Ll]og[^/]*$"
|
||||
|
||||
# Author lines.
|
||||
color green "^(19|20).*"
|
||||
# Dates.
|
||||
color red "^(19|20)[0-9-]{8}"
|
||||
# Email addresses.
|
||||
color yellow "<[^>]*@[^>]*>"
|
||||
|
||||
# Command-line options.
|
||||
color cyan "[[:space:]]-[a-zA-Z\$]" "--[8a-z-]+"
|
||||
# Bug and patch numbers.
|
||||
color cyan "(BZ|bug|patch) #[0-9]+" "PR [[:alnum:]]+/[0-9]+"
|
||||
# Probable constants, for variety.
|
||||
color brightred "\<[A-Z_][0-9A-Z_]+\>"
|
||||
# Key sequences.
|
||||
color brightblue "\^[A-Z^\]" "\<M-." "\<F1?[0-9]" "(\^|M-)Space"
|
||||
|
||||
# Changed files.
|
||||
color magenta start="^( | {8})\* " end="(:( |$)|^$)"
|
||||
|
||||
# Release markers.
|
||||
color brightblue "^(GNU )?nano[- ][0-9]\.[0-9]\.[^ ]+"
|
||||
|
||||
# Trailing whitespace.
|
||||
color ,green "[[:space:]]+$"
|
19
original/cmake.nanorc
Normal file
19
original/cmake.nanorc
Normal file
@ -0,0 +1,19 @@
|
||||
## Syntax highlighting for CMake files.
|
||||
|
||||
syntax cmake "(CMakeLists\.txt|\.cmake)$"
|
||||
comment "#"
|
||||
|
||||
color green "^[[:space:]]*[0-9A-Za-z_]+"
|
||||
icolor brightyellow "^[[:space:]]*(include|include_directories|include_external_msproject)\>"
|
||||
|
||||
icolor brightgreen "^[[:space:]]*((else|end)?if|else|(end)?while|(end)?foreach|break)\>"
|
||||
color brightgreen "\<(NOT|COMMAND|POLICY|TARGET|EXISTS|IS_(DIRECTORY|ABSOLUTE)|DEFINED)[[:space:]]"
|
||||
color brightgreen "[[:space:]](OR|AND|IS_NEWER_THAN|MATCHES|(STR|VERSION_)?(LESS|GREATER|EQUAL))[[:space:]]"
|
||||
|
||||
icolor brightred "^[[:space:]]*((end)?(function|macro)|return)"
|
||||
|
||||
icolor cyan start="\$(ENV)?\{" end="\}"
|
||||
color magenta "\<(APPLE|UNIX|WIN32|CYGWIN|BORLAND|MINGW|MSVC(_IDE|60|71|80|90)?)\>"
|
||||
|
||||
color brightblue "(^|[[:space:]])#.*"
|
||||
color ,green "[[:space:]]+$"
|
11
original/css.nanorc
Normal file
11
original/css.nanorc
Normal file
@ -0,0 +1,11 @@
|
||||
## Here is an example for CSS files.
|
||||
|
||||
syntax css "\.css$"
|
||||
comment "/*|*/"
|
||||
|
||||
color brightred "."
|
||||
color brightyellow start="\{" end="\}"
|
||||
color brightwhite start=":" end="([;^\{]|$)"
|
||||
color brightblue ":active|:focus|:hover|:link|:visited|:link|:after|:before|$"
|
||||
color brightblue start="\/\*" end="\\*/"
|
||||
color green ";|:|\{|\}"
|
21
original/debian.nanorc
Normal file
21
original/debian.nanorc
Normal file
@ -0,0 +1,21 @@
|
||||
## Here is an example for apt's sources.list.
|
||||
|
||||
syntax sources.list "sources\.list(\.d/.*\.list)?(~|\.old|\.save)?$"
|
||||
comment "#"
|
||||
|
||||
# Coloring the deb lines, working from tail to head. First the
|
||||
# components -- well, everything, and thus also the components.
|
||||
color brightmagenta "^deb.*"
|
||||
# Distribution -- well, everything, except the components.
|
||||
color brightred "^deb(-src)?\s+.*((ftp|https?|rsh|ssh|copy|file|spacewalk|tor):/\S+|cdrom:\[.+\]/)\s+\S+"
|
||||
# URIs.
|
||||
color brightgreen "^deb(-src)?\s+.*(ftp|https?|rsh|ssh|copy|file|spacewalk|tor):/\S+"
|
||||
# CDroms.
|
||||
color brightgreen "^deb(-src)?\s+.*cdrom:\[.+\]/"
|
||||
# Options.
|
||||
color brightcyan "^deb(-src)?\s+\[.+\]\s+"
|
||||
# And finally the initial deb tag.
|
||||
color yellow "^deb(-src)?"
|
||||
|
||||
# Comments.
|
||||
color brightblue "#.*"
|
20
original/default.nanorc
Normal file
20
original/default.nanorc
Normal file
@ -0,0 +1,20 @@
|
||||
## An example of a default syntax. The default syntax is used for
|
||||
## files that do not match any other syntax.
|
||||
|
||||
syntax default
|
||||
comment "#"
|
||||
|
||||
# Comments.
|
||||
color cyan "^[[:space:]]*#.*"
|
||||
|
||||
# Spaces in front of tabs.
|
||||
color ,red " + +"
|
||||
|
||||
# Nano's name, including version.
|
||||
color brightred "(GNU )?[Nn]ano [1-4]\.[0-9][-.[:alnum:]]*\>"
|
||||
|
||||
# Email addresses.
|
||||
color magenta "<[[:alnum:].%_+-]+@[[:alnum:].-]+\.[[:alpha:]]{2,}>"
|
||||
|
||||
# Bracketed captions in certain config files.
|
||||
color brightgreen "^\[.*\]$"
|
33
original/elisp.nanorc
Normal file
33
original/elisp.nanorc
Normal file
@ -0,0 +1,33 @@
|
||||
## Here is an example for Emacs Lisp.
|
||||
|
||||
syntax elisp "\.el$"
|
||||
magic "Lisp/Scheme program"
|
||||
comment ";"
|
||||
|
||||
# Basic functions/macros
|
||||
color brightcyan "\<(if|when|unless|cond|and|or|lambda|let|progn|while|dolist|dotimes)\>"
|
||||
color brightcyan "\<save-((window-)?excursion|restriction)\>"
|
||||
color brightcyan "\<eval-(and|when)-compile\>"
|
||||
# Defining functions
|
||||
color brightcyan "\<def(un|macro|subst|generic|alias)\>"
|
||||
color brightcyan "\<cl-def(un|macro|subst|generic|struct|type)\>"
|
||||
color brightcyan "\<define-(derived|minor|generic)-mode\>"
|
||||
# Defining variables
|
||||
color brightcyan "\<def(class|const|var(-local|alias)?)\>"
|
||||
# Customization functions
|
||||
color brightcyan "\<def(custom|face|group|theme)\>"
|
||||
# Setting values
|
||||
color brightcyan "\<(setq(-default|-local)?|setf|push|pop|declare(-function)?)\>"
|
||||
# Feature functions
|
||||
color brightcyan "\<(require|provide)\>"
|
||||
# Quoted symbols
|
||||
color brightyellow "#?'\<(\w|-)+\>"
|
||||
# Booleans
|
||||
color brightred "\<(t|nil)\>"
|
||||
# Keywords
|
||||
color blue ":(\w|[?-])+"
|
||||
# Strings
|
||||
color yellow start="^[[:blank:]]+\"" end="[^\]\""
|
||||
color yellow ""(\\.|[^"])*""
|
||||
# Comments
|
||||
color cyan "(^|[[:space:]]);.*"
|
40
original/fortran.nanorc
Normal file
40
original/fortran.nanorc
Normal file
@ -0,0 +1,40 @@
|
||||
## Here is an example for Fortran 90/95.
|
||||
|
||||
syntax fortran "\.(f|f90|f95)$"
|
||||
comment "!"
|
||||
|
||||
color red "\<[0-9]+\>"
|
||||
|
||||
icolor green "\<(action|advance|all|allocatable|allocated|any|apostrophe)\>"
|
||||
icolor green "\<(append|asis|assign|assignment|associated|character|common)\>"
|
||||
icolor green "\<(complex|data|default|delim|dimension|double precision)\>"
|
||||
icolor green "\<(elemental|epsilon|external|file|fmt|form|format|huge)\>"
|
||||
icolor green "\<(implicit|include|index|inquire|integer|intent|interface)\>"
|
||||
icolor green "\<(intrinsic|iostat|kind|logical|module|none|null|only)>"
|
||||
icolor green "\<(operator|optional|pack|parameter|pointer|position|private)\>"
|
||||
icolor green "\<(program|public|real|recl|recursive|selected_int_kind)\>"
|
||||
icolor green "\<(selected_real_kind|subroutine|status)\>"
|
||||
|
||||
icolor cyan "\<(abs|achar|adjustl|adjustr|allocate|bit_size|call|char)\>"
|
||||
icolor cyan "\<(close|contains|count|cpu_time|cshift|date_and_time)\>"
|
||||
icolor cyan "\<(deallocate|digits|dot_product|eor|eoshift|function|iachar)\>"
|
||||
icolor cyan "\<(iand|ibclr|ibits|ibset|ichar|ieor|iolength|ior|ishft|ishftc)\>"
|
||||
icolor cyan "\<(lbound|len|len_trim|matmul|maxexponent|maxloc|maxval|merge)\>"
|
||||
icolor cyan "\<(minexponent|minloc|minval|mvbits|namelist|nearest|nullify)\>"
|
||||
icolor cyan "\<(open|pad|present|print|product|pure|quote|radix)\>"
|
||||
icolor cyan "\<(random_number|random_seed|range|read|readwrite|replace)\>"
|
||||
icolor cyan "\<(reshape|rewind|save|scan|sequence|shape|sign|size|spacing)\>"
|
||||
icolor cyan "\<(spread|sum|system_clock|target|transfer|transpose|trim)\>"
|
||||
icolor cyan "\<(ubound|unpack|verify|write|tiny|type|use|yes)\>"
|
||||
|
||||
icolor yellow "\<(.and.|case|do|else|else?if|else?where|end|end?do|end?if)\>"
|
||||
icolor yellow "\<(end?select|.eqv.|forall|if|lge|lgt|lle|llt|.neqv.|.not.)\>"
|
||||
icolor yellow "\<(.or.|repeat|select case|then|where|while)\>"
|
||||
|
||||
icolor magenta "\<(continue|cycle|exit|go?to|result|return)\>"
|
||||
|
||||
# Strings.
|
||||
color yellow "<[^= ]*>" ""(\\.|[^"])*""
|
||||
|
||||
# Comments.
|
||||
color blue "!.*"
|
74
original/gentoo.nanorc
Normal file
74
original/gentoo.nanorc
Normal file
@ -0,0 +1,74 @@
|
||||
## Here is an example for Gentoo ebuilds/eclasses,
|
||||
## and (further down) one for Portage control files.
|
||||
|
||||
syntax ebuild "\.e(build|class|blit)$"
|
||||
comment "#"
|
||||
|
||||
## All the standard portage functions:
|
||||
color brightgreen "(^|\<default_)src_(unpack|prepare|configure|compile|install|test)\>"
|
||||
color brightgreen "^pkg_(config|nofetch|info|pretend|setup|(pre|post)(inst|rm))\>"
|
||||
color brightgreen "\<default(_pkg_nofetch|_src_(unpack|prepare|configure|compile|test))?\>"
|
||||
## Bash-related syntax:
|
||||
color green "\<(break|case|continue|do|done|elif|else|esac|exit|fi|for|function|if|in|read|return|select|shift|then|time|until|while)\>"
|
||||
color green "\<(declare|eval|exec|export|let|local)\>"
|
||||
color green "[{}():;|`$<>!=&\\]" "(\]|\[)"
|
||||
color green "-[defhnrsuwxzL]\>"
|
||||
color green "-(eq|ne|gt|lt|ge|le)\>"
|
||||
## Variables... official portage ones in red, all others in bright red:
|
||||
color brightred "\$[-0-9@*#?$!]" "\$[[:alpha:]_][[:alnum:]_]*"
|
||||
color brightred "\$\{[#!]?([-@*#?$!]|[0-9]+|[[:alpha:]_][[:alnum:]_]*)(\[([[:digit:]]|@)+\])?(([#%/]|:?[-=?+])[^}]*\}|\[|\})"
|
||||
color red "\<(EAPI|ARCH|HOMEPAGE|DESCRIPTION|IUSE|SRC_URI|LICENSE|SLOT|KEYWORDS|[HPR]?DEPEND|PROVIDE|PROPERTIES|REQUIRED_USE|RESTRICT|USERLAND)\>"
|
||||
color red "\<(S|E?D|T|PV|PF|P|PN|PR|PVR|A|CATEGORY|DISTDIR|FILESDIR|EPREFIX|E?ROOT|WORKDIR)\>"
|
||||
color red "\<(AS|C(PP|XX)?|LD)FLAGS\>" "\<C(HOST|TARGET|BUILD)\>" "\<(MERGE_TYPE|REPLACING_VERSIONS|REPLACED_BY_VERSION)\>"
|
||||
color red "\<EBUILD_PHASE(_FUNC)?\>"
|
||||
color red "\<QA_((TEXTRELS|EXECSTACK|WX_LOAD)(_[a-zA-Z_0-9]+)?|DT_HASH|PRESTRIPPED)\>"
|
||||
color red "\<(PATCHES|(HTML_)?DOCS)\>" "\<WANT_(AUTO(CONF|MAKE)|LIBTOOL)\>" "\<AT_M4DIR\>"
|
||||
## Portage commands:
|
||||
color magenta "\<(use(_(with|enable|if_iuse)|x)?|in_iuse) [!a-zA-Z0-9_+ -]*" "inherit.*"
|
||||
color brightblue "\<e(begin|end|conf|install|make|qmake4|ant|(qa)?warn|infon?|error|log|patch(_user)?|new(group|user))\>"
|
||||
color brightblue "\<e(pause|beep|mktemp|(cvs|svn)_clean|punt_cxx)\>" "\<e(aclocal|auto(reconf|header|conf|make)|libtoolize)\>"
|
||||
color brightblue "\<e(stack|shopts|umask)_(push|pop)\>" "\<version_is_at_least\>"
|
||||
color brightblue "\<make_desktop_entry\>" "\<unpack(_(makeself|pdv))?\>"
|
||||
color brightblue "\<(die|hasv?|inherit|nonfatal)\>" "\<(use(_(with|enable|if_iuse)|x)?|in_iuse)\>" "\<(has|best)_version\>"
|
||||
color brightblue "\<(do|new)(ins|(games)?s?bin|doc|lib(\.so|\.a)?|man|info|exe|initd|confd|envd|pam|menu|icon)\>"
|
||||
color brightblue "\<do(compress|header|python|sed|dir|hard|sym|html|jar|mo)\>" "\<keepdir\>"
|
||||
color brightblue "\<prepall(docs|info|man|strip)?\>" "\<prep(info|lib|lib\.(so|a)|man|strip|gamesdirs)\>"
|
||||
color brightblue "\<(doc|ins|exe)?into\>" "\<(f|games)(owners|perms)\>" "\<(exe|ins|dir)opts\>"
|
||||
color brightblue "\<tc-get(BUILD_)?(AR|AS|CC|CPP|CXX|LD|NM|OBJCOPY|PKG_CONFIG|RANLIB)\>"
|
||||
color brightblue "\<tc-(arch(-kernel)?|export|has-(tls|openmp))\>"
|
||||
## Common commands used in ebuilds:
|
||||
color blue "\<(awk|cat|cd|chmod|chown|cp|echo|env|find|e?grep|ln|make|mkdir|mv|popd|printf|pushd|rm|rmdir|sed|set|tar|touch|unset|xargs)\>"
|
||||
## Comments (doesn't work that well):
|
||||
color yellow "(^|[[:space:]])#.*"
|
||||
## Strings (doesn't work that well):
|
||||
color brightyellow ""(\\.|[^\"])*"" "'(\\.|[^'])*'"
|
||||
## Trailing space is bad!
|
||||
color ,green "[[:space:]]+$"
|
||||
## Mixed whitespace is also bad.
|
||||
color ,green " "
|
||||
|
||||
|
||||
syntax /etc/portage "\.(accept_keywords|env|keywords|mask|unmask|use)(/.+)?$"
|
||||
comment "#"
|
||||
|
||||
## Base text:
|
||||
color green ".+"
|
||||
## Likely version and slot numbers:
|
||||
color magenta "-[[:digit:].]+(_(alpha|beta|pre|rc|p)[[:digit:]]*)*(-r[[:digit:]]+)?([:[:space:]]|$)"
|
||||
color magenta ":[^[:space:]]+([[:space:]]|$)"
|
||||
## Use flags (must come after version/slot):
|
||||
color brightred "[[:space:]]+\+?[A-Za-z0-9+_@-]+"
|
||||
color brightblue "[[:space:]]+-[A-Za-z0-9+_@-]+"
|
||||
## Accepted arches:
|
||||
color white "[~-]?\<(alpha|amd64|arm(64)?|hppa|ia64|m68k|mips|nios2|ppc(64)?|riscv|s390|sh|sparc|x86)(-(aix|(f|free|net|open)bsd|cygwin|hpux|interix|linux|macos|mint|solaris|winnt))?\>"
|
||||
color white "[[:space:]][*~-]?\*"
|
||||
## Categories:
|
||||
color cyan "^[[:space:]]*[^/]*/"
|
||||
## Masking regulators:
|
||||
color brightmagenta "^[[:space:]]*(=|~|<|<=|>|>=)"
|
||||
## Comments:
|
||||
color yellow "#.*"
|
||||
## Trailing space is bad!
|
||||
color ,green "[[:space:]]+$"
|
||||
## Mixed whitespace is also bad.
|
||||
color ,green " "
|
41
original/go.nanorc
Normal file
41
original/go.nanorc
Normal file
@ -0,0 +1,41 @@
|
||||
## Here is an example for Go.
|
||||
|
||||
syntax go "\.go$"
|
||||
comment "//"
|
||||
|
||||
# Types.
|
||||
color green "\<(bool|u?int(8|16|32|64)?|float(32|64)|complex(64|128)|byte|rune|uintptr|string|error)\>"
|
||||
color green "\<((<-[[:space:]]*)chan|chan[[:space:]]*<-|const|func|interface|map|struct|type|var)\>"
|
||||
|
||||
# Predefined functions.
|
||||
color blue "\<(append|cap|close|complex|copy|delete|imag|len|make|new|panic|print|println|real|recover)\>"
|
||||
|
||||
# Control structures.
|
||||
color brightyellow "\<(case|default|defer|else|for|go|if|range|select|switch)\>"
|
||||
|
||||
# Control flow.
|
||||
color magenta "\<(break|continue|fallthrough|goto|return)\>"
|
||||
|
||||
# Declarations.
|
||||
color brightcyan "\<(package|import)\>"
|
||||
color brightcyan "//[[:space:]]*\+build[[:space:]]+(([a-zA-Z_0-9]+[[:space:]]*)+,[[:space:]]*)*[a-zA-Z_0-9]+"
|
||||
|
||||
# Literals.
|
||||
color red "\<([1-9][0-9]*|0[0-7]*|0[xX][0-9A-Fa-f]+)\>"
|
||||
color red "\<[0-9]+\.[0-9]*([eE][+-]?[0-9]+)?i?\>"
|
||||
color red "\<[0-9]+[eE][+-]?[0-9]+i?\>"
|
||||
color red "\B\.[0-9]+([eE][+-]?[0-9]+)?i?\>"
|
||||
color red "\<[0-9]+i\>"
|
||||
|
||||
# Strings and characters; slightly fuzzy.
|
||||
color red "\<(true|false|nil|iota|_)\>"
|
||||
color red "'(\\.|[^'])+'"
|
||||
color red ""(\\.|[^"])*""
|
||||
color red start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
|
||||
|
||||
# Comments.
|
||||
color brightblue "//.*"
|
||||
color brightblue start="/\*" end="\*/"
|
||||
|
||||
# Trailing whitespace.
|
||||
color ,green "[[:space:]]+$"
|
26
original/groff.nanorc
Normal file
26
original/groff.nanorc
Normal file
@ -0,0 +1,26 @@
|
||||
## Here is an example for groff.
|
||||
|
||||
syntax groff "(/tmac\.[^/]+$|\.(m[ems]|rof|tmac)$)"
|
||||
comment ".\""
|
||||
|
||||
# The argument of .ds or .nr
|
||||
color cyan "^\.(ds|nr) [^[:space:]]*"
|
||||
# Single-character escapes
|
||||
color brightmagenta "\\."
|
||||
# The argument of \f or \s in the same color
|
||||
color brightmagenta "\\f." "\\f\(.." "\\s(\+|\-)?[0-9]"
|
||||
# Newlines
|
||||
color cyan "(\\|\\\\)n(.|\(..)"
|
||||
color cyan start="(\\|\\\\)n\[" end="]"
|
||||
# Requests
|
||||
color brightgreen "^\.[[:space:]]*[^[:space:]]*"
|
||||
# Comments
|
||||
color yellow "^\.\\".*"
|
||||
# Strings
|
||||
color green "(\\|\\\\)\*(.|\(..)"
|
||||
color green start="(\\|\\\\)\*\[" end="]"
|
||||
# Characters
|
||||
color brightred "\\\(.."
|
||||
color brightred start="\\\[" end="]"
|
||||
# Macro arguments
|
||||
color brightcyan "\\\\\$[1-9]"
|
24
original/guile.nanorc
Normal file
24
original/guile.nanorc
Normal file
@ -0,0 +1,24 @@
|
||||
## Here is an example for Guile Scheme.
|
||||
|
||||
syntax guile "\.scm$"
|
||||
header "^#!.*guile"
|
||||
comment ";"
|
||||
|
||||
# Basic scheme functions
|
||||
color green "\<(do|if|lambda|let(rec)?|map|unless|when)\>"
|
||||
# Defining things
|
||||
color brightcyan "\<define(-macro|-module|-public|-syntax)?\>"
|
||||
# Quoted symbols
|
||||
color brightyellow "'\<(\w|-)+\>"
|
||||
# Chars
|
||||
color brightmagenta "#\\."
|
||||
color brightmagenta "#\\\w+\>"
|
||||
# Booleans
|
||||
color brightred "(#t|#f)\>"
|
||||
# Keywords
|
||||
color blue "#?:(\w|[?-])+"
|
||||
# Strings
|
||||
color yellow start="^[[:blank:]]+\"" end="[^\]\""
|
||||
color yellow ""(\\.|[^"])*""
|
||||
# Comments
|
||||
color cyan "(^|[[:space:]]);.*"
|
28
original/html.nanorc
Normal file
28
original/html.nanorc
Normal file
@ -0,0 +1,28 @@
|
||||
## Here is an example for HTML.
|
||||
|
||||
syntax html "\.html?$"
|
||||
magic "HTML document"
|
||||
comment "<!--|-->"
|
||||
|
||||
# Tags:
|
||||
color cyan "<[[:alpha:]/!?][^>]*>"
|
||||
# Bold, italic, and underlined:
|
||||
color brightmagenta "</?[biu]>"
|
||||
|
||||
# Named character references:
|
||||
color red "&[^;[:space:]]*;"
|
||||
# Strings:
|
||||
color green ""(\\.|[^"])*""
|
||||
|
||||
# Attributes:
|
||||
color red "(abbr|accept(-charset)?|accesskey|action|alink|align|alt|archive|axis|background|bgcolor|border)="
|
||||
color red "(cell(padding|spacing)|char(off|set)?|checked|cite|class(id)?|compact|code(base|tag)?|cols(pan)?)="
|
||||
color red "(content(editable)?|contextmenu|coords|data|datetime|declare|defer|dir|disabled|enctype)="
|
||||
color red "(for|frame(border)?|headers|height|hidden|href(lang)?|hspace|http-equiv|id|ismap)="
|
||||
color red "(label|lang|link|longdesc|margin(height|width)|maxlength|media|method|multiple)="
|
||||
color red "(name|nohref|noresize|noshade|object|onclick|onfocus|onload|onmouseover|profile|readonly|rel|rev)="
|
||||
color red "(rows(pan)?|rules|scheme|scope|scrolling|selected|shape|size|span|src|standby|start|style|summary)="
|
||||
color red "(tabindex|target|text|title|type|usemap|valign|value(type)?|vlink|vspace|width|xmlns|xml:space)="
|
||||
|
||||
# Comments:
|
||||
color yellow start="<!--" end="-->"
|
16
original/java.nanorc
Normal file
16
original/java.nanorc
Normal file
@ -0,0 +1,16 @@
|
||||
## Here is an example for Java.
|
||||
|
||||
syntax java "\.java$"
|
||||
magic "Java "
|
||||
comment "//"
|
||||
|
||||
color green "\<(boolean|byte|char|double|float|int|long|new|short|this|transient|void)\>"
|
||||
color red "\<(break|case|catch|continue|default|do|else|finally|for|if|return|switch|throw|try|while)\>"
|
||||
color cyan "\<(abstract|class|extends|final|implements|import|instanceof|interface|native)\>"
|
||||
color cyan "\<(package|private|protected|public|static|strictfp|super|synchronized|throws|volatile)\>"
|
||||
color red ""[^"]*""
|
||||
color yellow "\<(true|false|null)\>"
|
||||
color blue "//.*"
|
||||
color blue start="/\*" end="\*/"
|
||||
color brightblue start="/\*\*" end="\*/"
|
||||
color ,green "[[:space:]]+$"
|
24
original/javascript.nanorc
Normal file
24
original/javascript.nanorc
Normal file
@ -0,0 +1,24 @@
|
||||
## Syntax highlighting for Javascript.
|
||||
|
||||
syntax javascript "\.js$"
|
||||
comment "//"
|
||||
|
||||
# Declarational stuff.
|
||||
color green "\<(async|class|const|extends|function|let|this|typeof|var|void)\>"
|
||||
# Flow control and special keywords.
|
||||
color brightyellow "\<(do|while|if|else|switch|case|default|for|each|in|of|with)\>"
|
||||
color brightyellow "\<(await|export|import|throw|try|catch|finally|new|delete)\>"
|
||||
# "Exit" points.
|
||||
color magenta "\<(break|continue|return|yield)\>"
|
||||
|
||||
# Octal/decimal and hexadecimal numbers.
|
||||
color cyan "\<[0-9]+\>" "\<0x[0-9A-Fa-f]+\>"
|
||||
|
||||
# Strings.
|
||||
color brightmagenta ""(\\.|[^"])*"" "'(\\.|[^'])*'" "`(\\.|[^`])*`"
|
||||
# Comments.
|
||||
color brightblue "(^|[[:space:]])//.*"
|
||||
color brightblue start="/\*" end="\*/"
|
||||
|
||||
# Trailing whitespace.
|
||||
color ,green "[[:space:]]+$"
|
34
original/json.nanorc
Normal file
34
original/json.nanorc
Normal file
@ -0,0 +1,34 @@
|
||||
## Syntax highlighting for JSON files.
|
||||
|
||||
# See: http://www.json.org/
|
||||
# Original author: Aapo Rantalainen
|
||||
# License: GPLv3 or newer
|
||||
|
||||
syntax json "\.json$"
|
||||
# No comments are permitted in JSON.
|
||||
comment ""
|
||||
|
||||
# Numbers (used as value).
|
||||
color green ":[[:space:]]*\-?(0|[1-9][0-9]*)(\.[0-9]+)?([Ee]?[-+]?[0-9]+)?"
|
||||
# Values (well, any string).
|
||||
color brightmagenta "\".+\""
|
||||
# Hex numbers (used as value).
|
||||
color green ":[[:space:]]*\"#[0-9abcdefABCDEF]+\""
|
||||
# Escapes.
|
||||
color green "\\\\" "\\\"" "\\[bfnrt]" "\\u[0-9abcdefABCDEF]{4})"
|
||||
# Special words.
|
||||
color green "(true|false|null)"
|
||||
|
||||
# Names (very unlikely to contain a quote).
|
||||
color brightblue "\"[^"]+\"[[:space:]]*:"
|
||||
|
||||
# Brackets, braces, and separators.
|
||||
color brightblue "\[" "\]"
|
||||
color brightred "\{" "\}"
|
||||
color brightred "," ":"
|
||||
|
||||
# Comments.
|
||||
color cyan "(^|[[:space:]]+)(//|#).*"
|
||||
|
||||
# Trailing whitespace.
|
||||
color ,green "[[:space:]]+$"
|
60
original/lua.nanorc
Normal file
60
original/lua.nanorc
Normal file
@ -0,0 +1,60 @@
|
||||
## Syntax highlighting for Lua.
|
||||
#
|
||||
## Original author: Matthew Wild <mwild1 (at) gmail.com>
|
||||
## License: GPL 3 or later
|
||||
|
||||
syntax lua "\.lua$"
|
||||
magic "Lua script"
|
||||
linter "luacheck --no-color"
|
||||
comment "--"
|
||||
|
||||
color brightwhite "\[\[.*\]\]"
|
||||
|
||||
# Operators
|
||||
color brightyellow ":|\*|/|%|\+|-|\^|>|>=|<|<=|~=|=|\.\.|#|\<(not|and|or)\>"
|
||||
# Don't partially color ... as an operator
|
||||
color normal "\.\.\."
|
||||
|
||||
# Statements
|
||||
color brightblue "\<(do|end|while|repeat|until|if|elseif|then|else|for|in|function|local|return|break)\>"
|
||||
|
||||
# Keywords
|
||||
color brightyellow "\<(_G|_VERSION|assert|collectgarbage|dofile|error|getfenv|getmetatable|ipairs|load|loadfile|module|next|pairs|pcall|print|rawequal|rawget|rawlen|rawset|require|select|setfenv|setmetatable|tonumber|tostring|type|unpack|xpcall)\s*\("
|
||||
|
||||
# Standard library
|
||||
color brightyellow "\<coroutine\.(create|isyieldable|resume|running|status|wrap|yield)\>"
|
||||
color brightyellow "\<debug\.(debug|(get|set)(fenv|hook|local|metatable|(up|user)value)|getinfo|getregistry|traceback|upvalue(id|join))\>"
|
||||
color brightyellow "\<io\.(close|flush|input|lines|output|p?open|read|tmpfile|type|write|std(in|out|err))\>"
|
||||
color brightyellow "\<math\.(abs|acos|asin|atan2?|ceil|cosh?|deg|exp|floor|fmod|frexp|huge|ldexp|log10|log)\>"
|
||||
color brightyellow "\<math\.((max|min)(integer)?|modf?|pi|pow|rad|random(seed)?|sinh?|sqrt|tan|tointeger|type|ult)\>"
|
||||
color brightyellow "\<os\.(clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname)\>"
|
||||
color brightyellow "\<package\.(config|cpath|loaded|loadlib|path|preload|searchers|searchpath|seeall)\>"
|
||||
color brightyellow "\<string\.(byte|char|dump|find|format|gmatch|gsub|len|lower|match|pack|packsize|rep|reverse|sub|unpack|upper)\>"
|
||||
color brightyellow "\<table\.(concat|insert|maxn|move|pack|remove|sort|unpack)\>"
|
||||
color brightyellow "\<utf8\.(char|charpattern|codepoint|codes|len|offset)\>"
|
||||
|
||||
# File handle methods
|
||||
color brightyellow ":(close|flush|lines|read|seek|setvbuf|write)\>"
|
||||
|
||||
# External files
|
||||
color brightgreen "\<(dofile|require)\>"
|
||||
|
||||
# Special words
|
||||
color brightmagenta "\<(false|nil|true)\>"
|
||||
|
||||
# Decimal and hexadecimal numbers
|
||||
color red "\<[0-9]+(\.[0-9]*)?([Ee][+-]?[0-9]+)?\>"
|
||||
color red "\<0x[0-9A-Fa-f]+(\.[0-9A-Fa-f]*)?([Pp][+-]?[0-9]+)?\>"
|
||||
|
||||
# Brackets
|
||||
color brightmagenta "\(|\)|\[|\]|\{|\}"
|
||||
|
||||
# Shebang
|
||||
color brightcyan "^#!.*"
|
||||
|
||||
# Strings
|
||||
color red ""(\\.|[^"\])*"|'(\\.|[^'\])*'"
|
||||
|
||||
# Simple comments and multiline comments
|
||||
color green "--.*"
|
||||
color green start="--\[\[" end="\]\]"
|
24
original/makefile.nanorc
Normal file
24
original/makefile.nanorc
Normal file
@ -0,0 +1,24 @@
|
||||
## Here is an example for Makefiles.
|
||||
|
||||
syntax makefile "(/((GNU)?m|M)akefile[^/]*$|\.(make|mk)$)"
|
||||
magic "makefile script"
|
||||
comment "#"
|
||||
|
||||
# Assignments.
|
||||
color red " (:?:|\+|\?)?= "
|
||||
|
||||
# Keywords.
|
||||
color magenta "^(if|ifn?def|ifn?eq|else|endif|(-|s)?include)\>"
|
||||
color magenta "^((override +)?(un)?define|endef|(un)?export|private|vpath)\>"
|
||||
|
||||
# Variable expansions.
|
||||
color blue "\$+[{(][a-zA-Z0-9_-]+[})]"
|
||||
|
||||
# Targets.
|
||||
color brightblue "^[^ ]+:"
|
||||
|
||||
# Comments.
|
||||
color green "(^|[[:space:]]+)#.*"
|
||||
|
||||
# Trailing whitespace.
|
||||
color ,green "[[:space:]]+$"
|
23
original/man.nanorc
Normal file
23
original/man.nanorc
Normal file
@ -0,0 +1,23 @@
|
||||
## Syntax highlighting for man pages.
|
||||
|
||||
syntax man "\.[1-9]x?$"
|
||||
magic "troff or preprocessor input"
|
||||
comment ".\""
|
||||
|
||||
# Section headers, title line, and indented paragraphs.
|
||||
color green "^\.(SH|SS|TH) .*"
|
||||
color brightgreen "^\.(SH|SS|TH) " "^\.([HIT]P)"
|
||||
# Type faces, and normal paragraphs.
|
||||
color brightred "^\.(B[IR]?|I[BR]?|R[BI]|S[BM]) .*"
|
||||
color brightblue "^\.(B[IR]?|I[BR]?|R[BI]|S[BM]) " "^\.([LP]?P)$"
|
||||
# Inline type faces.
|
||||
color magenta "\\f[BIPR]"
|
||||
# Relative margins, hyperlinks, and various other stuff.
|
||||
color yellow "^\.(RS|RE|UR|UE|PD|DT)"
|
||||
color yellow "^\.(ad|bp|br|ce|de|ds|el|ie|if|fi|ft|hy|ig|in|na|ne|nf|nh|ps|so|sp|ti|tr)"
|
||||
|
||||
# Comments.
|
||||
color cyan "(^\.)?\\\".*"
|
||||
|
||||
# Trailing whitespace.
|
||||
color ,green "[[:space:]]+$"
|
9
original/mgp.nanorc
Normal file
9
original/mgp.nanorc
Normal file
@ -0,0 +1,9 @@
|
||||
## Here is an example for Magicpoint presentations.
|
||||
|
||||
syntax mgp "\.mgp$"
|
||||
header "^%include.*"
|
||||
comment "#"
|
||||
|
||||
color green "^%[A-Za-z].*"
|
||||
color cyan "(^|[[:space:]])(#|%%).*"
|
||||
color ,green "[[:space:]]+$"
|
9
original/mutt.nanorc
Normal file
9
original/mutt.nanorc
Normal file
@ -0,0 +1,9 @@
|
||||
## Here is an example for quoted emails (under e.g. mutt).
|
||||
|
||||
syntax mutt
|
||||
|
||||
# Quoted lines.
|
||||
color green "^>.*"
|
||||
|
||||
# Signatures, even quoted ones.
|
||||
color yellow start="^>* ?-- $" end="^>* ?$"
|
11
original/nanohelp.nanorc
Normal file
11
original/nanohelp.nanorc
Normal file
@ -0,0 +1,11 @@
|
||||
## This is meant for highlighting key combos in a nano help text.
|
||||
|
||||
# It should not apply to any normal file, so no fileregex.
|
||||
syntax nanohelp
|
||||
|
||||
# Key combos:
|
||||
color cyan "\^[]4-8A-Z^\_◀▶▲▼]" "[◀▶▲▼]" "\<M-." "\<F1?[0-9]"
|
||||
color cyan "\<((Sh-)?Tab|Enter|Ins|(Sh-\^?)?Del|Space|Bsp|Up|Down|Left|Right|Home|End|PgUp|PgDn)\>"
|
||||
|
||||
# Quoted indicators:
|
||||
color brightred "'(\^|M-)'"
|
32
original/nanorc.nanorc
Normal file
32
original/nanorc.nanorc
Normal file
@ -0,0 +1,32 @@
|
||||
## Here is an example for nanorc files.
|
||||
|
||||
syntax nanorc "\.?nanorc$"
|
||||
comment "#"
|
||||
|
||||
# Possible errors and parameters
|
||||
icolor brightred "^[[:space:]]*((un)?(bind|set)|include|syntax|header|magic|comment|linter|i?color|extendsyntax).*"
|
||||
|
||||
# Keywords
|
||||
icolor brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(afterends|allow_insecure_backup|atblanks|autoindent|backup|backwards|boldtext|breaklonglines|casesensitive|constantshow|cutfromcursor|emptyline|finalnewline|historylog|jumpyscrolling|linenumbers|locking|morespace|mouse|multibuffer|noconvert|nohelp|nopauses|nonewlines|nowrap|positionlog|preserve|quickblank|quiet|rebinddelete|rebindkeypad|regexp|showcursor|smarthome|smooth|softwrap|suspend|tabstospaces|tempfile|trimblanks|unix|view|wordbounds|zap)\>"
|
||||
icolor yellow "^[[:space:]]*set[[:space:]]+((error|function|key|number|selected|status|stripe|title)color)[[:space:]]+(bright)?(white|black|red|blue|green|yellow|magenta|cyan|normal)?(,(white|black|red|blue|green|yellow|magenta|cyan|normal))?\>"
|
||||
icolor brightgreen "^[[:space:]]*set[[:space:]]+(backupdir|brackets|errorcolor|functioncolor|keycolor|matchbrackets|numbercolor|operatingdir|punct|quotestr|selectedcolor|speller|statuscolor|stripecolor|titlecolor|whitespace|wordchars)[[:space:]]+"
|
||||
icolor brightgreen "^[[:space:]]*set[[:space:]]+(fill[[:space:]]+-?[[:digit:]]+|(guidestripe|tabsize)[[:space:]]+[1-9][0-9]*)\>"
|
||||
icolor brightgreen "^[[:space:]]*bind[[:space:]]+((\^([[:alpha:]]|[]@\^_]|Space)|M-([[:alpha:]]|[]!"#$%&'()*+,./0-9:;<=>?@\^_`{|}~-]|Space))|F([1-9]|1[0-6])|Ins|Del)[[:space:]]+([[:alpha:]]+|".*")[[:space:]]+(all|main|search|replace(with)?|yesno|gotoline|writeout|insert|ext(ernal)?cmd|help|spell|linter|browser|whereisfile|gotodir)([[:space:]]+#|[[:space:]]*$)"
|
||||
icolor brightgreen "^[[:space:]]*unbind[[:space:]]+((\^([[:alpha:]]|[]@\^_]|Space)|M-([[:alpha:]]|[]!"#$%&'()*+,./0-9:;<=>?@\^_`{|}~-]|Space))|F([1-9]|1[0-6])|Ins|Del)[[:space:]]+(all|main|search|replace(with)?|yesno|gotoline|writeout|insert|ext(ernal)?cmd|help|spell|linter|browser|whereisfile|gotodir)([[:space:]]+#|[[:space:]]*$)"
|
||||
icolor brightgreen "^[[:space:]]*extendsyntax[[:space:]]+[[:alpha:]]+[[:space:]]+(i?color|header|magic|comment|linter)[[:space:]]+.*"
|
||||
icolor brightgreen "^[[:space:]]*(syntax|linter)[[:space:]]+[^[:blank:]]+"
|
||||
icolor green "^[[:space:]]*((un)?(bind|set)|include|syntax|header|magic|comment|linter|extendsyntax)\>"
|
||||
|
||||
# Strings
|
||||
color brightmagenta "([[:space:]]|(start|end)=)".+"([[:space:]]|$)"
|
||||
|
||||
# Colors
|
||||
icolor yellow "^[[:space:]]*i?color[[:space:]]*(bright)?(white|black|red|blue|green|yellow|magenta|cyan|normal)?(,(white|black|red|blue|green|yellow|magenta|cyan|normal))?\>"
|
||||
icolor magenta "^[[:space:]]*i?color\>" "\<(start|end)="
|
||||
|
||||
# Comments
|
||||
color brightblue "(^|[[:space:]]+)#.*"
|
||||
color cyan "^[[:space:]]*##.*"
|
||||
|
||||
# Trailing whitespace
|
||||
color ,green "[[:space:]]+$"
|
30
original/nftables.nanorc
Normal file
30
original/nftables.nanorc
Normal file
@ -0,0 +1,30 @@
|
||||
## Here is an example for nftables.
|
||||
|
||||
syntax nftables "\.(nft|nftables)$"
|
||||
header "^#!.*(nft|nftables)"
|
||||
comment "#"
|
||||
|
||||
# Objects and operations
|
||||
color green "\<(chain|hook|policy|priority|ruleset|set|table|type|v?map)\>"
|
||||
color green "\<(define|include)\>"
|
||||
color red "\<(add|delete|flush|insert|remove|replace)\>"
|
||||
|
||||
# Families
|
||||
color yellow "\<(arp|bridge|inet|ingress|ip6?|netdev)\>"
|
||||
|
||||
# Terminal statements
|
||||
color red "\<(drop|reject)\>"
|
||||
color brightblue "\<(accept|continue|(d|s)nat|goto|jump|masquerade|return)\>"
|
||||
|
||||
# Comments
|
||||
color cyan "(^|[[:space:]])#.*"
|
||||
|
||||
# Trailing whitespace
|
||||
color ,green "[[:space:]]+$"
|
||||
|
||||
# Strings and others
|
||||
color yellow ""(\\.|[^"])*"" "'(\\.|[^'])*'"
|
||||
color green "[{}():;|`$<>!=&\\]" "(\]|\[)"
|
||||
|
||||
# Basic variable names
|
||||
color brightred "(\$|@)[[:alpha:]_-][[:alnum:]_.-]*"
|
42
original/objc.nanorc
Normal file
42
original/objc.nanorc
Normal file
@ -0,0 +1,42 @@
|
||||
## Here is an example for C/C++/Obj-C.
|
||||
|
||||
syntax m "\.m$"
|
||||
magic "Objective-C source"
|
||||
comment "//"
|
||||
|
||||
# Stuffs,
|
||||
color brightwhite "\<[A-Z_][0-9A-Z_]+\>"
|
||||
color green "\<(float|double|BOOL|bool|char|int|short|long|id|sizeof|enum|void|static|const|struct|union|typedef|extern|(un)?signed|inline)\>"
|
||||
color green "\<[[:alpha:]_][[:alnum:]_]*_t\>"
|
||||
color green "\<(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\>"
|
||||
color brightgreen "\<(for|if|while|do|else|case|default|switch)\>"
|
||||
color brightgreen "\<(try|throw|catch|operator|new|delete)\>"
|
||||
color brightgreen "\<(goto|continue|break|return)\>"
|
||||
color brightgreen "@(encode|end|implementation|interface)|selector)\>"
|
||||
|
||||
# GCC builtins.
|
||||
color cyan "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
|
||||
|
||||
# Selector/method.
|
||||
color brightmagenta "(^|[[:space:]])\[.*[[:space:]].*\]"
|
||||
color white ":[[:alnum:]]*"
|
||||
color magenta "[[:alnum:]]*:"
|
||||
color white "\[[^][:space:]]*\]"
|
||||
|
||||
# Strings.
|
||||
color brightblack "'([^'\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'"
|
||||
color brightblack "<[^= ]*>" ""(\\.|[^"])*""
|
||||
color brightblue "@"(\\.|[^"])*""
|
||||
# Multiline strings. This regex is VERY resource intensive,
|
||||
# and sometimes colours things that shouldn't be coloured.
|
||||
###color brightyellow start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
|
||||
|
||||
# Preprocessor commands.
|
||||
color brightblue "^[[:space:]]*#[[:space:]]*(define|include|import|(un|ifn?)def|endif|el(if|se)|if|warning|error)"
|
||||
|
||||
# Comments.
|
||||
color yellow "//.*"
|
||||
color yellow start="/\*" end="\*/"
|
||||
|
||||
# Trailing whitespace.
|
||||
color ,green "[[:space:]]+$"
|
30
original/ocaml.nanorc
Normal file
30
original/ocaml.nanorc
Normal file
@ -0,0 +1,30 @@
|
||||
## Syntax highlighting for OCaml.
|
||||
|
||||
syntax ocaml "\.mli?$"
|
||||
magic "OCaml"
|
||||
comment "(*|*)"
|
||||
|
||||
# Uid:
|
||||
color red "\<[A-Z][0-9a-z_]{2,}\>"
|
||||
# Declarations:
|
||||
color green "\<(let|val|method|in|and|rec|private|virtual|constraint)\>"
|
||||
# Structure items:
|
||||
color red "\<(type|open|class|module|exception|external)\>"
|
||||
# Patterns:
|
||||
color blue "\<(fun|function|functor|match|try|with)\>"
|
||||
# Pattern modifiers:
|
||||
color yellow "\<(as|when|of)\>"
|
||||
# Conditions:
|
||||
color cyan "\<(if|then|else)\>"
|
||||
# Blocks:
|
||||
color magenta "\<(begin|end|object|struct|sig|for|while|do|done|to|downto)\>"
|
||||
# Constants:
|
||||
color green "\<(true|false)\>"
|
||||
# Modules/classes:
|
||||
color green "\<(include|inherit|initializer)\>"
|
||||
# Expression modifiers:
|
||||
color yellow "\<(new|ref|mutable|lazy|assert|raise)\>"
|
||||
# Comments:
|
||||
color white start="\(\*" end="\*\)"
|
||||
# Strings: (no multiline handling yet)
|
||||
color brightblack ""[^\"]*""
|
26
original/patch.nanorc
Normal file
26
original/patch.nanorc
Normal file
@ -0,0 +1,26 @@
|
||||
## Here is an example for patch files.
|
||||
|
||||
syntax patch "\.(patch|diff|debdiff)$"
|
||||
magic "diff output"
|
||||
# There is no official support for comments in patch files.
|
||||
comment ""
|
||||
|
||||
# Added lines.
|
||||
color brightgreen "^\+.*"
|
||||
# Show trailing whitespace only on added lines.
|
||||
color ,green "[[:space:]]+$"
|
||||
# Context lines.
|
||||
color brightblue "^ .*"
|
||||
# Deleted lines.
|
||||
color brightred "^-.*"
|
||||
|
||||
# Header lines.
|
||||
color magenta "^(Index:|diff)[[:blank:]].*"
|
||||
# File names and dates.
|
||||
color red "^---.*"
|
||||
color green "^\+\+\+.*"
|
||||
# Line numbers.
|
||||
color brightyellow "^@@.*"
|
||||
|
||||
# Statistics.
|
||||
color cyan start="^---$" end="^$"
|
24
original/perl.nanorc
Normal file
24
original/perl.nanorc
Normal file
@ -0,0 +1,24 @@
|
||||
## Here is an example for Perl.
|
||||
|
||||
syntax perl "\.p[lm]$"
|
||||
header "^#!.*perl"
|
||||
magic "Perl script"
|
||||
comment "#"
|
||||
|
||||
color red "\<(accept|alarm|atan2|bin(d|mode)|c(aller|h(dir|mod|op|own|root)|lose(dir)?|onnect|os|rypt)|d(bm(close|open)|efined|elete|ie|o|ump)|e(ach|of|val|x(ec|ists|it|p))|f(cntl|ileno|lock|ork))\>" "\<(get(c|login|peername|pgrp|ppid|priority|pwnam|(host|net|proto|serv)byname|pwuid|grgid|(host|net)byaddr|protobynumber|servbyport)|([gs]et|end)(pw|gr|host|net|proto|serv)ent|getsock(name|opt)|gmtime|goto|grep|hex|index|int|ioctl|join)\>" "\<(keys|kill|last|length|link|listen|local(time)?|log|lstat|m|mkdir|msg(ctl|get|snd|rcv)|next|oct|open(dir)?|ord|pack|pipe|pop|printf?|push|q|qq|qx|rand|re(ad(dir|link)?|cv|do|name|quire|set|turn|verse|winddir)|rindex|rmdir|s|scalar|seek(dir)?)\>" "\<(se(lect|mctl|mget|mop|nd|tpgrp|tpriority|tsockopt)|shift|shm(ctl|get|read|write)|shutdown|sin|sleep|socket(pair)?|sort|spli(ce|t)|sprintf|sqrt|srand|stat|study|substr|symlink|sys(call|read|tem|write)|tell(dir)?|time|tr(y)?|truncate|umask)\>" "\<(un(def|link|pack|shift)|utime|values|vec|wait(pid)?|wantarray|warn|write)\>"
|
||||
color magenta "\<(continue|else|elsif|do|for|foreach|if|unless|until|while|eq|ne|lt|gt|le|ge|cmp|x|my|sub|use|package|can|isa)\>"
|
||||
|
||||
# Variable names.
|
||||
color cyan "[$%&@]([A-Za-z_][0-9A-Za-z_]*|\^[][A-Z?\^_]|[0-9]+)\>"
|
||||
color cyan "[$%&@]\{(\^?[A-Za-z_][0-9A-Za-z_]*|\^[][?\^][0-9]+)\}"
|
||||
color cyan "[$%&@]([][!"#'()*+,.:;<=>?`|~-]|\{[][!-/:-@\`|~]\})|\$[$%&@]"
|
||||
color cyan "(^|[[:space:]])[$%@][/\]"
|
||||
|
||||
color yellow "".*"|qq\|.*\|"
|
||||
color white "[sm]/.*/"
|
||||
color white start="(^use| = new)" end=";"
|
||||
|
||||
# Comments.
|
||||
color green "(^|[[:space:]])#.*"
|
||||
|
||||
color yellow start="<< 'STOP'" end="STOP"
|
35
original/php.nanorc
Normal file
35
original/php.nanorc
Normal file
@ -0,0 +1,35 @@
|
||||
## Here is an example for PHP.
|
||||
|
||||
syntax php "\.(php[23457s~]?|phtml|ctp)$"
|
||||
magic "PHP script"
|
||||
comment "//"
|
||||
|
||||
# PHP markings.
|
||||
color brightgreen "(<\?(php)?|\?>)"
|
||||
|
||||
# Function names.
|
||||
color white "\<[A-Za-z_][A-Za-z_0-9]*\("
|
||||
# Variable names.
|
||||
color cyan "\$[A-Za-z_][A-Za-z_0-9]*"
|
||||
|
||||
# Types.
|
||||
color green "\<(array|bool|callable|const|float|global|int|object|string|var)\>"
|
||||
|
||||
# Directives and structure.
|
||||
color brightcyan "\<(abstract|as|class|clone|(end)?declare|extends|function|implements|include(_once)?|inst(ance|ead)of|interface|namespace|new|private|protected|public|require(_once)?|static|trait|use|yield)\>"
|
||||
color brightcyan "\<(case|catch|default|do|echo|else(if)?|end(for(each)?|if|switch|while)|final(ly)?|for(each)?|if|print|switch|throw|try|while)\>"
|
||||
# Operators.
|
||||
color brightcyan "\<(and|or|xor)\>"
|
||||
|
||||
# Control flow.
|
||||
color magenta "\<(break|continue|goto|return)\>"
|
||||
|
||||
# Strings.
|
||||
color brightyellow ""(\.|[^"])*"" "'(\.|[^'])*'"
|
||||
|
||||
# Comments.
|
||||
color brightblue "(^|[[:space:]]+)//.*"
|
||||
color brightblue start="/\*" end="\*/"
|
||||
|
||||
# Trailing whitespace.
|
||||
color ,green "[[:space:]]+$"
|
29
original/po.nanorc
Normal file
29
original/po.nanorc
Normal file
@ -0,0 +1,29 @@
|
||||
## Colouring for PO files.
|
||||
|
||||
syntax po "\.pot?$"
|
||||
comment "#"
|
||||
|
||||
# Comments.
|
||||
color green "^#.*$"
|
||||
color yellow "Copyright|\(C\)"
|
||||
# Header fields.
|
||||
color brightred "^\"X-Bugs:.*\"$"
|
||||
color brightmagenta "\<(Project\-Id\-Version|Report\-Msgid\-Bugs\-To|Last\-Translator|Language(\-Team)?|X-Bugs|X-Generator|Plural\-Forms)\>"
|
||||
color cyan "\<(POT\-Creation\-Date|PO\-Revision\-Date|MIME\-Version|Content\-Type|Content\-Transfer\-Encoding)\>"
|
||||
# Encodings and numbers.
|
||||
color yellow "\<(UTF|ISO|Windows|Mac|IBM)-[0-9]+"
|
||||
color yellow "\<((pre|rc)?[0-9]+|[0-9]bit)\>"
|
||||
# Msgids.
|
||||
color brightblue "^(msgid|msgid_plural|msgstr)\>"
|
||||
# Tags.
|
||||
color red " fuzzy(,|$)"
|
||||
color yellow " (no-)?[-[:alpha:]]+-format(,|$)"
|
||||
# Format specifiers.
|
||||
color brightmagenta "%([1-9]\$)?[a-z]*"
|
||||
# Quotes and escaped characters.
|
||||
color yellow "\""
|
||||
color cyan "\\([abcefnrtv"\]|x[0-9abcdefABCDEF]{2}|[0-7]{3})"
|
||||
# Reminders.
|
||||
color brightwhite,yellow "(FIXME|TODO|XXX)"
|
||||
# Obsolete strings.
|
||||
color red "#~.*"
|
74
original/postgresql.nanorc
Normal file
74
original/postgresql.nanorc
Normal file
@ -0,0 +1,74 @@
|
||||
## Here is an example for PostgreSQL.
|
||||
|
||||
syntax sql "\.sql[2345s~]?$"
|
||||
comment "-- "
|
||||
|
||||
# Functions.
|
||||
color white "\<[a-z_]*\("
|
||||
|
||||
# Types.
|
||||
color green "\<(int2|smallint|int4|int|integer|int8|bigint|decimal|numeric|real|double precision|(small|big)?serial)\>"
|
||||
color green "\<(bit( varying)?|boolean|bytea|enum|money|tsvector|uuid)\>"
|
||||
color green "\<(char|varchar|character( varying)?|text)\>"
|
||||
color green "\<(date|interval|time(stamp)?( with time zone| without time zone)?)\>"
|
||||
color green "\<(point|line|lseg|path|box|polygon|circle)\>"
|
||||
color green "\<(cidr|inet|macaddr)\>"
|
||||
color green "\<(daterange|int4range|int8range|numrange|tsrange|tstzrange)\>"
|
||||
|
||||
# Structure.
|
||||
color brightyellow "\<(CASE|CLASS|DEFAULT|DO|ELSE|ELSEIF|FOR|FOREACH|FUNCTION|IF|IS NULL)\>"
|
||||
color brightyellow "\<(NEW|PRIVATE|PUBLIC|RETURN|RETURNS|SETOF|SWITCH|THEN|WHEN|WHILE)>"
|
||||
|
||||
# Control flow.
|
||||
color magenta "\<(EXCEPTION|NOTICE|RAISE|RETURN)\>"
|
||||
|
||||
# SQL keywords.
|
||||
color blue "\<(ABORT|AGGREGATE|ALTER|ANALYZE|AND|AS|AUTHORIZATION|BEGIN|CAST|CHECKPOINT|CLASS|CLOSE)\>"
|
||||
color blue "\<(CLUSTER|COLLATION|COMMENT|COMMIT|CONFIGURATION|CONSTRAINTS|CONVERSION|COPY|CREATE)\>"
|
||||
color blue "\<(DATA|DATABASE|DEALLOCATE|DECLARE|DEFAULT|DELETE|DICTIONARY|DISCARD|DO|DOMAIN|DROP)\>"
|
||||
color blue "\<(END|EVENT|EXECUTE|EXPLAIN|EXTENSION|FAMILY|FETCH|FOREIGN|FROM|FUNCTION)\>"
|
||||
color blue "\<(GRANT|GROUP|IF NOT EXISTS|IMMUTABLE|INDEX|INSERT|INTO|LABEL|LANGUAGE|LARGE|LOAD|LOCK)\>"
|
||||
color blue "\<(MAPPING FOR|MATERIALIZED|MOVE|NOTIFY|OBJECT|OPERATOR|OPTIONS|OWNED|OWNER)\>"
|
||||
color blue "\<(PARSER|PREPARED?|PRIVILEGES|REASSIGN|REFRESH|RELEASE|RESET|REVOKE|ROLE|ROLLBACK|RULE)\>"
|
||||
color blue "\<(SAVEPOINT|SCHEMA|SEARCH|SECURITY|SELECT|SEQUENCE|SERVER|SESSION|SET|SHOW|SPACE|START|SYSTEM)\>"
|
||||
color blue "\<(TABLE|TEXT|TO|TRANSACTION|TYPE|UPDATE|USER|VACUUM|VALUES|VIEW|WHERE|WITH|WRAPPER)\>"
|
||||
|
||||
# Strings.
|
||||
color brightyellow "<[^= ]*>" ""(\.|[^"])*""
|
||||
|
||||
# Trailing whitespace.
|
||||
color ,green "[[:space:]]+$"
|
||||
|
||||
# Regular expressions.
|
||||
color brightmagenta "/([^/]|(\\/))*/[iomx]*" "%r\{([^}]|(\\}))*\}[iomx]*"
|
||||
|
||||
# Shell command expansion is in `backticks` or like %x{this}. These are
|
||||
# "double-quotish" (to use a perlism).
|
||||
color brightblue "`[^`]*`" "%x\{[^}]*\}"
|
||||
|
||||
# Strings, double-quoted.
|
||||
color green ""([^"]|(\\"))*"" "%[QW]?\{[^}]*\}" "%[QW]?\([^)]*\)" "%[QW]?<[^>]*>"
|
||||
color green "%[QW]?\[[^]]*\]" "%[QW]?\$[^$]*\$" "%[QW]?\^[^^]*\^" "%[QW]?![^!]*!"
|
||||
|
||||
# Expression substitution. These go inside double-quoted strings,
|
||||
# "like #{this}".
|
||||
color brightgreen "#\{[^}]*\}"
|
||||
|
||||
# Strings, single-quoted.
|
||||
color green "'([^']|(\\'))*'" "%[qw]\{[^}]*\}" "%[qw]\([^)]*\)" "%[qw]<[^>]*>"
|
||||
color green "%[qw]\[[^]]*\]" "%[qw]\$[^$]*\$" "%[qw]\^[^^]*\^" "%[qw]![^!]*!"
|
||||
|
||||
# Comments.
|
||||
color red "##?[^{].*" "##?$"
|
||||
color red "--[^{].*" "--$"
|
||||
color brightblue "//.*"
|
||||
color brightblue start="/\*" end="\*/"
|
||||
|
||||
# PostgreSQL markings.
|
||||
color red "(--)"
|
||||
|
||||
# PostgreSQL default schemas.
|
||||
color brightred "(pg_catalog|public)"
|
||||
|
||||
# PostgreSQL PLs.
|
||||
color brightblue "(pljava|plperlu?|plpgsql|plpy|plpythonu?|plr|plruby|plsh|pltcl|plscheme)"
|
16
original/pov.nanorc
Normal file
16
original/pov.nanorc
Normal file
@ -0,0 +1,16 @@
|
||||
## Here is an example for POV-Ray.
|
||||
|
||||
syntax pov "\.(pov|POV|povray|POVRAY)$"
|
||||
comment "//"
|
||||
|
||||
color brightcyan "^[[:space:]]*#[[:space:]]*(declare)"
|
||||
color brightyellow "\<(sphere|cylinder|translate|matrix|rotate|scale)\>"
|
||||
color brightyellow "\<(orthographic|location|up|right|direction|clipped_by)\>"
|
||||
color brightyellow "\<(fog_type|fog_offset|fog_alt|rgb|distance|transform)\>"
|
||||
color brightred "\<(background|camera|fog|light_source|object|texture)\>"
|
||||
color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
|
||||
color brightmagenta "\<(union|group|subgroup)\>"
|
||||
|
||||
# Comments.
|
||||
color brightblue "//.*"
|
||||
color brightblue start="/\*" end="\*/"
|
39
original/python.nanorc
Normal file
39
original/python.nanorc
Normal file
@ -0,0 +1,39 @@
|
||||
## Here is an example for Python.
|
||||
|
||||
syntax python "\.py$"
|
||||
header "^#!.*python"
|
||||
magic "Python script"
|
||||
linter pyflakes
|
||||
comment "#"
|
||||
|
||||
# Function definitions.
|
||||
color brightblue "def [0-9A-Za-z_]+"
|
||||
# Keywords.
|
||||
color brightcyan "\<(and|as|assert|async|await|break|class|continue)\>"
|
||||
color brightcyan "\<(def|del|elif|else|except|finally|for|from)\>"
|
||||
color brightcyan "\<(global|if|import|in|is|lambda|nonlocal|not|or)\>"
|
||||
color brightcyan "\<(pass|raise|return|try|while|with|yield)\>"
|
||||
|
||||
# These two are keywords in Python 2, but functions in Python 3,
|
||||
# so only color them when they are followed by whitespace, assuming
|
||||
# that print(x) is a function invocation and print (x) is a statement.
|
||||
color brightcyan "\<(exec|print)([[:blank:]]|$)"
|
||||
|
||||
# Special values.
|
||||
color brightmagenta "\<(False|None|True)\>"
|
||||
|
||||
# Mono-quoted strings.
|
||||
color brightgreen "'([^'\]|\\.)*'|'''"
|
||||
color brightgreen ""([^"\]|\\.)*"|""""
|
||||
color normal "'''|""""
|
||||
# Comments.
|
||||
color brightred "(^|[[:blank:]])#.*"
|
||||
# Triple-quoted strings.
|
||||
color brightgreen start="'''([^'),]|$)" end="(^|[^(\])'''"
|
||||
color brightgreen start=""""([^"),]|$)" end="(^|[^(\])""""
|
||||
|
||||
# Reminders.
|
||||
color brightwhite,yellow "(FIXME|TODO|XXX)"
|
||||
|
||||
# Trailing whitespace.
|
||||
color ,green "[[:space:]]+$"
|
36
original/ruby.nanorc
Normal file
36
original/ruby.nanorc
Normal file
@ -0,0 +1,36 @@
|
||||
## Here is an example for Ruby.
|
||||
|
||||
syntax ruby "\.rb$"
|
||||
header "^#!.*ruby"
|
||||
magic "Ruby script"
|
||||
linter ruby -w -c
|
||||
comment "#"
|
||||
|
||||
# Reserved words.
|
||||
color yellow "\<(BEGIN|END|alias|and|begin|break|case|class|def|defined\?|do|else|elsif|end|ensure|false|for|if|in|module)\>"
|
||||
color yellow "\<(next|nil|not|or|redo|rescue|retry|return|self|super|then|true|undef|unless|until|when|while|yield)\>"
|
||||
# Constants.
|
||||
color brightblue "(\$|@|@@)?\<[A-Z]+[0-9A-Z_a-z]*"
|
||||
# Ruby "symbols".
|
||||
color magenta "([ ]|^):[0-9A-Za-z_]+\>"
|
||||
# Some unique things we want to stand out.
|
||||
color brightyellow "\<(__FILE__|__LINE__)\>"
|
||||
# Regular expressions.
|
||||
color brightmagenta "/([^/]|(\\/))*/[iomx]*" "%r\{([^}]|(\\}))*\}[iomx]*"
|
||||
# Shell command expansion is in `backticks` or like %x{this}. These are
|
||||
# "double-quotish" (to use a perlism).
|
||||
color brightblue "`[^`]*`" "%x\{[^}]*\}"
|
||||
# Strings, double-quoted.
|
||||
color green ""([^"]|(\\"))*"" "%[QW]?\{[^}]*\}" "%[QW]?\([^)]*\)" "%[QW]?<[^>]*>" "%[QW]?\[[^]]*\]" "%[QW]?\$[^$]*\$" "%[QW]?\^[^^]*\^" "%[QW]?![^!]*!"
|
||||
# Expression substitution. These go inside double-quoted strings,
|
||||
# "like #{this}".
|
||||
color brightgreen "#\{[^}]*\}"
|
||||
# Strings, single-quoted.
|
||||
color green "'([^']|(\\'))*'" "%[qw]\{[^}]*\}" "%[qw]\([^)]*\)" "%[qw]<[^>]*>" "%[qw]\[[^]]*\]" "%[qw]\$[^$]*\$" "%[qw]\^[^^]*\^" "%[qw]![^!]*!"
|
||||
# Comments.
|
||||
color cyan "#[^{].*" "#$"
|
||||
color brightcyan "##[^{].*" "##$"
|
||||
# "Here" docs.
|
||||
color green start="<<-?'?EOT'?" end="^EOT"
|
||||
# Some common markers.
|
||||
color brightcyan "(XXX|TODO|FIXME|\?\?\?)"
|
39
original/rust.nanorc
Normal file
39
original/rust.nanorc
Normal file
@ -0,0 +1,39 @@
|
||||
## Syntax highlighting for Rust.
|
||||
## Copyright 2015 Luke Francl.
|
||||
## Licensed under GPL version 3.
|
||||
|
||||
## NOTE: Rules are applied in order: later rules re-colorize matching text.
|
||||
|
||||
syntax rust "\.(rlib|rs)$"
|
||||
comment "//"
|
||||
|
||||
# Function definitions
|
||||
color magenta "fn [a-z_0-9]+"
|
||||
|
||||
# Reserved words
|
||||
color yellow "\<(abstract|alignof|as|become|box|break|const|continue|crate|do|else|enum|extern|false|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|offsetof|override|priv|pub|pure|ref|return|sizeof|static|self|struct|super|true|trait|type|typeof|unsafe|unsized|use|virtual|where|while|yield)\>"
|
||||
|
||||
# Macros
|
||||
color red "[a-z_]+!"
|
||||
|
||||
# Constants
|
||||
color magenta "[A-Z][A-Z_0-9]+"
|
||||
|
||||
# Traits/Enums/Structs/Types/...
|
||||
color magenta "[A-Z][A-Za-z0-9]+"
|
||||
|
||||
# Strings
|
||||
color green "\".*\""
|
||||
color green start="\".*\\$" end=".*\""
|
||||
## NOTE: This isn't accurate, but matching "#{0,} for the end of the string is too liberal.
|
||||
color green start="r#+\"" end="\"#+"
|
||||
|
||||
# Comments
|
||||
color blue "//.*"
|
||||
color blue start="/\*" end="\*/"
|
||||
|
||||
# Attributes
|
||||
color magenta start="#!\[" end="\]"
|
||||
|
||||
# Some common markers
|
||||
color brightcyan "(XXX|TODO|FIXME|\?\?\?)"
|
37
original/sh.nanorc
Normal file
37
original/sh.nanorc
Normal file
@ -0,0 +1,37 @@
|
||||
## Here is an example for Bourne shell scripts.
|
||||
|
||||
syntax sh "(\.sh|\.(a|ba|c|da|k|mk|pdk|tc|z)(sh|shrc|sh_profile)|/(etc/|\.)profile)$"
|
||||
header "^#!.*/(((a|ba|c|da|k|mk|pdk|tc|z)?sh)|(busybox|env) +sh|openrc-run|runscript)"
|
||||
magic "(POSIX|Bourne-Again) shell script.*text"
|
||||
linter dash -n
|
||||
comment "#"
|
||||
|
||||
# Function declarations.
|
||||
color brightgreen "^[A-Za-z0-9_-]+\(\)"
|
||||
|
||||
# Keywords, symbols, and comparisons.
|
||||
color green "\<(break|case|continue|do|done|elif|else|esac|exit|fi|for|function|if|in|read|return|select|shift|then|time|until|while)\>"
|
||||
color green "\<(declare|eval|exec|export|let|local)\>"
|
||||
color green "[{}():;|`$<>!=&\\]" "(\]|\[)"
|
||||
color green "-(eq|ne|gt|lt|ge|le|ef|ot|nt)\>"
|
||||
|
||||
# Short and long options.
|
||||
color brightmagenta "[[:blank:]]-[A-Za-z]\>" "[[:blank:]]--[A-Za-z-]+\>"
|
||||
|
||||
# Common commands.
|
||||
color brightblue "\<(awk|cat|cd|ch(grp|mod|own)|cp|cut|echo|env|grep|head|install|ln|make|mkdir|mv|popd|printf|pushd|rm|rmdir|sed|set|sort|tail|tar|touch|umask|unset)\>"
|
||||
color normal "[.-]tar\>"
|
||||
|
||||
# Basic variable names (no braces).
|
||||
color brightred "\$[-0-9@*#?$!]" "\$[[:alpha:]_][[:alnum:]_]*"
|
||||
# More complicated variable names; handles braces and replacements and arrays.
|
||||
color brightred "\$\{[#!]?([-@*#?$!]|[0-9]+|[[:alpha:]_][[:alnum:]_]*)(\[([[:space:]]*[[:alnum:]_]+[[:space:]]*|@)\])?(([#%/]|:?[-=?+])[^}]*\}|\[|\})"
|
||||
|
||||
# Comments.
|
||||
color cyan "(^|[[:space:]])#.*"
|
||||
|
||||
# Strings.
|
||||
color brightyellow ""(\\.|[^"])*"" "'(\\.|[^'])*'"
|
||||
|
||||
# Trailing whitespace.
|
||||
color ,green "[[:space:]]+$"
|
40
original/spec.nanorc
Normal file
40
original/spec.nanorc
Normal file
@ -0,0 +1,40 @@
|
||||
## Syntax highlighting for RPM spec files.
|
||||
|
||||
syntax spec "\.spec(\.[^/]+)?$"
|
||||
comment "#"
|
||||
|
||||
# Main tags.
|
||||
color brightblue "((Icon|ExclusiveOs|ExcludeOs)[[:space:]]*:)"
|
||||
color brightblue "((BuildArch|BuildArchitectures|ExclusiveArch|ExcludeArch)[[:space:]]*:)"
|
||||
color brightblue "((Conflicts|Obsoletes|Provides|Requires|Requires\(.*\)|Enhances|Suggests|BuildConflicts|BuildRequires|Recommends|PreReq|Supplements)[[:space:]]*:)"
|
||||
color brightblue "((Epoch|Serial|Nosource|Nopatch)[[:space:]]*:)"
|
||||
color brightblue "((AutoReq|AutoProv|AutoReqProv)[[:space:]]*:)"
|
||||
color brightblue "((Copyright|License|Summary|Summary\(.*\)|Distribution|Vendor|Packager|Group|Source\d*|Patch\d*|BuildRoot|Prefix)[[:space:]]*:)"
|
||||
color brightblue "((Name|Version|Release|Url|URL)[[:space:]]*:)"
|
||||
color brightblue start="^Source" end=":" start="^Patch" end=":"
|
||||
# Architectures.
|
||||
color brightred "(i386|i486|i586|i686|athlon|ia64|alpha|alphaev5|alphaev56|alphapca56|alphaev6|alphaev67|sparc|sparcv9|sparc64armv3l|armv4b|armv4lm|ips|mipsel|ppc|ppc|iseries|ppcpseries|ppc64|m68k|m68kmint|Sgi|rs6000|i370|s390x|s390|noarch)"
|
||||
# Architecture conditionals.
|
||||
color brightred "(ifarch|ifnarch)"
|
||||
# OS conditionals.
|
||||
color brightred "(ifos|ifnos)"
|
||||
# %* strings.
|
||||
color green "%([A-Z_a-z_0-9_]*)"
|
||||
color magenta "%_([A-Z_a-z_0-9_]*)"
|
||||
color yellow start="%__" end="\ "
|
||||
color magenta start="%\{" end="\}"
|
||||
color yellow start="%\{__" end="\}"
|
||||
# Sections.
|
||||
color red "^%(build$|changelog|check$|clean$|description|files|install$|package|pre|prep$|pretrans|preun)"
|
||||
color red "^%(post|posttrans|postun|trigger|triggerin|triggerpostun|triggerun|verifyscript)"
|
||||
# Conditionals and defines.
|
||||
color brightred "%(if|else|endif|define|global|undefine)"
|
||||
|
||||
# Comments.
|
||||
color cyan "#.*"
|
||||
# Special case: "# norootforbuild" is handled as main tag.
|
||||
color brightblue "^# norootforbuild"
|
||||
# %changelog date entries.
|
||||
color brightyellow "^\* .*\)$"
|
||||
# Trailing whitespace.
|
||||
color ,green "[[:space:]]+$"
|
22
original/tcl.nanorc
Normal file
22
original/tcl.nanorc
Normal file
@ -0,0 +1,22 @@
|
||||
## Syntax highlighting for Tcl files.
|
||||
|
||||
syntax tcl "\.tcl$"
|
||||
magic "Tcl(/Tk)? script"
|
||||
comment "#"
|
||||
|
||||
# Standard Tcl [info commands]:
|
||||
color green "\<(after|append|array|auto_execok|auto_import|auto_load|auto_load_index|auto_qualify|binary|break|case|catch|cd|clock|close|concat|continue|encoding|eof|error|eval|exec|exit|expr|fblocked|fconfigure|fcopy|file|fileevent|flush|for|foreach|format|gets|glob|global|history|if|incr|info|interp|join|lappend|lindex|linsert|list|llength|load|lrange|lreplace|lsearch|lset|lsort|namespace|open|package|pid|puts|pwd|read|regexp|regsub|rename|return|scan|seek|set|socket|source|split|string|subst|switch|tclLog|tell|time|trace|unknown|unset|update|uplevel|upvar|variable|vwait|while)\>"
|
||||
# Basic Tcl subcommands:
|
||||
color green "\<array (anymore|donesearch|exists|get|names|nextelement|set|size|startsearch|statistics|unset)\>"
|
||||
color green "\<string (bytelength|compare|equal|first|index|is|last|length|map|match|range|repeat|replace|to|tolower|totitle|toupper|trim|trimleft|trimright|will|wordend|wordstart)\>"
|
||||
# Extended TclX [info commands]:
|
||||
color green "\<(alarm|auto_load_pkg|bsearch|catclose|catgets|catopen|ccollate|cconcat|cequal|chgrp|chmod|chown|chroot|cindex|clength|cmdtrace|commandloop|crange|csubstr|ctoken|ctype|dup|echo|execl|fcntl|flock|fork|fstat|ftruncate|funlock|host_info|id|infox|keyldel|keylget|keylkeys|keylset|kill|lassign|lcontain|lempty|lgets|link|lmatch|loadlibindex|loop|lvarcat|lvarpop|lvarpush|max|min|nice|pipe|profile|random|readdir|replicate|scancontext|scanfile|scanmatch|select|server_accept|server_create|signal|sleep|sync|system|tclx_findinit|tclx_fork|tclx_load_tndxs|tclx_sleep|tclx_system|tclx_wait|times|translit|try_eval|umask|wait)\>"
|
||||
# Syntax:
|
||||
color brightblue "proc[[:space:]]" "(\{|\})"
|
||||
color green "(\(|\)|\;|`|\\|\$|<|>|!|=|&|\|)"
|
||||
color brightyellow ""(\\.|[^"])*"" "'(\\.|[^'])*'"
|
||||
color brightred "\$\{?[0-9A-Za-z_!@#$*?-]+\}?"
|
||||
# Trailing whitespace:
|
||||
color ,green "[[:space:]]+$"
|
||||
# Comments:
|
||||
color cyan "^[[:space:]]*#.*"
|
10
original/tex.nanorc
Normal file
10
original/tex.nanorc
Normal file
@ -0,0 +1,10 @@
|
||||
## Here is a short example for TeX files.
|
||||
|
||||
syntax tex "\.tex$"
|
||||
magic "(La)?TeX document"
|
||||
linter chktex -v0 -q -I
|
||||
comment "%"
|
||||
|
||||
color green "\\.|\\[A-Za-z]*"
|
||||
color magenta "[{}]"
|
||||
color blue "(^|[^\])%.*"
|
21
original/texinfo.nanorc
Normal file
21
original/texinfo.nanorc
Normal file
@ -0,0 +1,21 @@
|
||||
## Here is an example for Texinfo files.
|
||||
|
||||
syntax texinfo "\.texi$"
|
||||
header "^\\input texinfo"
|
||||
magic "Texinfo source"
|
||||
comment "@c "
|
||||
|
||||
# Command arguments, trailing and enclosed.
|
||||
color cyan "^@[a-z]+[[:space:]]+.*$"
|
||||
color brightmagenta "@[a-zA-Z]+\{[^}]*\}"
|
||||
# Commands themselves.
|
||||
color yellow "@[a-zA-Z]+\{?" "\}"
|
||||
|
||||
# Menu items.
|
||||
color brightred "^\*[[:space:]]+.*::.*"
|
||||
|
||||
# Comments.
|
||||
color green "@c[[:space:]]+.*"
|
||||
|
||||
# Trailing whitespace.
|
||||
color ,green "[[:space:]]+$"
|
22
original/xml.nanorc
Normal file
22
original/xml.nanorc
Normal file
@ -0,0 +1,22 @@
|
||||
## Here is an example for XML files.
|
||||
|
||||
syntax xml "\.([jrsx]html?|jnlp|mml|pom|rng|sgml?|svg|w[as]dl|wsdd|xjb|xml|xs(d|lt?)|xul)$"
|
||||
header "<\?xml.*version=.*\?>"
|
||||
magic "(XML|SGML) (sub)?document"
|
||||
comment "<!--|-->"
|
||||
|
||||
# The entire content of the tag:
|
||||
color green start="<" end=">"
|
||||
|
||||
# The start and the end of the tag:
|
||||
color cyan "<[^> ]+" ">"
|
||||
|
||||
# The strings inside the tag:
|
||||
color magenta "\"[^"]*\""
|
||||
|
||||
# Comments:
|
||||
color yellow start="<!DOCTYPE" end="[/]?>"
|
||||
color yellow start="<!--" end="-->"
|
||||
|
||||
# Escapes:
|
||||
color red "&[^;]*;"
|
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/sed -f
|
||||
|
||||
# PROJECT
|
||||
## Our approach to nano's highlight.
|
||||
# CUSTOM
|
||||
## Highlight, GUI and shortcuts..
|
||||
|
||||
# GUI Colors
|
||||
## No GUI colors available, yet...
|
||||
|
Loading…
x
Reference in New Issue
Block a user