From ebe557e5572a1144a314ef8525806e6ea1b5b9ec Mon Sep 17 00:00:00 2001 From: nanorc Date: Tue, 16 Sep 2014 06:37:31 +0100 Subject: [PATCH] nanorc --- .gitignore | 1 + Makefile | 59 +++++++++++++ README.md | 148 +++++++++++++++++++++++++++++++++ awk.nanorc | 24 ++++++ c.nanorc | 21 +++++ cmake.nanorc | 9 ++ coffeescript.nanorc | 15 ++++ colortest.nanorc | 17 ++++ csharp.nanorc | 24 ++++++ css.nanorc | 31 +++++++ cython.nanorc | 25 ++++++ default.nanorc | 2 + dot.nanorc | 7 ++ email.nanorc | 5 ++ examples/C.c | 28 +++++++ examples/CMakeLists.txt | 17 ++++ examples/CSS.css | 14 ++++ examples/CSharp.cs | 11 +++ examples/ColorTest | 19 +++++ examples/Cython.pyx | 12 +++ examples/DOT.dot | 10 +++ examples/GLSL.glsl | 18 ++++ examples/Go.go | 25 ++++++ examples/HTML.html | 22 +++++ examples/INI.ini | 8 ++ examples/JSON.json | 16 ++++ examples/Java.java | 6 ++ examples/Lua.lua | 21 +++++ examples/Properties.properties | 19 +++++ examples/Python.py | 11 +++ examples/README.md | 21 +++++ examples/Scheme.scm | 13 +++ examples/git-rebase-todo | 15 ++++ git.nanorc | 18 ++++ glsl.nanorc | 13 +++ go.nanorc | 20 +++++ html.nanorc | 22 +++++ ini.nanorc | 9 ++ inputrc.nanorc | 9 ++ java.nanorc | 25 ++++++ javascript.nanorc | 20 +++++ json.nanorc | 10 +++ keymap.nanorc | 9 ++ kickstart.nanorc | 14 ++++ ledger.nanorc | 9 ++ lisp.nanorc | 13 +++ lua.nanorc | 22 +++++ makefile.nanorc | 22 +++++ man.nanorc | 8 ++ markdown.nanorc | 17 ++++ mixins.sed | 36 ++++++++ mixins/boolean.nanorc | 1 + mixins/ccomment.nanorc | 2 + mixins/function.nanorc | 2 + mixins/hashcomment.nanorc | 1 + mixins/ini.nanorc | 2 + mixins/lint.nanorc | 3 + mixins/longline.nanorc | 1 + mixins/string.nanorc | 1 + mixins/todo.nanorc | 1 + mpdconf.nanorc | 8 ++ nanorc.nanorc | 18 ++++ nginx.nanorc | 13 +++ patch.nanorc | 9 ++ peg.nanorc | 11 +++ php.nanorc | 16 ++++ pkg-config.nanorc | 7 ++ pkgbuild.nanorc | 21 +++++ po.nanorc | 7 ++ privoxy.nanorc | 26 ++++++ properties.nanorc | 8 ++ python.nanorc | 20 +++++ rpmspec.nanorc | 26 ++++++ ruby.nanorc | 10 +++ sed.nanorc | 8 ++ shell.nanorc | 16 ++++ sql.nanorc | 33 ++++++++ systemd.nanorc | 11 +++ tex.nanorc | 6 ++ theme.sed | 19 +++++ vala.nanorc | 16 ++++ vi.nanorc | 9 ++ xml.nanorc | 11 +++ xresources.nanorc | 9 ++ yaml.nanorc | 12 +++ yum.nanorc | 6 ++ 86 files changed, 1360 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 README.md create mode 100644 awk.nanorc create mode 100644 c.nanorc create mode 100644 cmake.nanorc create mode 100644 coffeescript.nanorc create mode 100644 colortest.nanorc create mode 100644 csharp.nanorc create mode 100644 css.nanorc create mode 100644 cython.nanorc create mode 100644 default.nanorc create mode 100644 dot.nanorc create mode 100644 email.nanorc create mode 100644 examples/C.c create mode 100644 examples/CMakeLists.txt create mode 100644 examples/CSS.css create mode 100644 examples/CSharp.cs create mode 100644 examples/ColorTest create mode 100644 examples/Cython.pyx create mode 100644 examples/DOT.dot create mode 100644 examples/GLSL.glsl create mode 100644 examples/Go.go create mode 100644 examples/HTML.html create mode 100644 examples/INI.ini create mode 100644 examples/JSON.json create mode 100644 examples/Java.java create mode 100644 examples/Lua.lua create mode 100644 examples/Properties.properties create mode 100644 examples/Python.py create mode 100644 examples/README.md create mode 100644 examples/Scheme.scm create mode 100644 examples/git-rebase-todo create mode 100644 git.nanorc create mode 100644 glsl.nanorc create mode 100644 go.nanorc create mode 100644 html.nanorc create mode 100644 ini.nanorc create mode 100644 inputrc.nanorc create mode 100644 java.nanorc create mode 100644 javascript.nanorc create mode 100644 json.nanorc create mode 100644 keymap.nanorc create mode 100644 kickstart.nanorc create mode 100644 ledger.nanorc create mode 100644 lisp.nanorc create mode 100644 lua.nanorc create mode 100644 makefile.nanorc create mode 100644 man.nanorc create mode 100644 markdown.nanorc create mode 100644 mixins.sed create mode 100644 mixins/boolean.nanorc create mode 100644 mixins/ccomment.nanorc create mode 100644 mixins/function.nanorc create mode 100644 mixins/hashcomment.nanorc create mode 100644 mixins/ini.nanorc create mode 100644 mixins/lint.nanorc create mode 100644 mixins/longline.nanorc create mode 100644 mixins/string.nanorc create mode 100644 mixins/todo.nanorc create mode 100644 mpdconf.nanorc create mode 100644 nanorc.nanorc create mode 100644 nginx.nanorc create mode 100644 patch.nanorc create mode 100644 peg.nanorc create mode 100644 php.nanorc create mode 100644 pkg-config.nanorc create mode 100644 pkgbuild.nanorc create mode 100644 po.nanorc create mode 100644 privoxy.nanorc create mode 100644 properties.nanorc create mode 100644 python.nanorc create mode 100644 rpmspec.nanorc create mode 100644 ruby.nanorc create mode 100644 sed.nanorc create mode 100644 shell.nanorc create mode 100644 sql.nanorc create mode 100644 systemd.nanorc create mode 100644 tex.nanorc create mode 100644 theme.sed create mode 100644 vala.nanorc create mode 100644 vi.nanorc create mode 100644 xml.nanorc create mode 100644 xresources.nanorc create mode 100644 yaml.nanorc create mode 100644 yum.nanorc diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..567609b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f7bd264 --- /dev/null +++ b/Makefile @@ -0,0 +1,59 @@ +LANGS = awk c cmake coffeescript colortest csharp css cython default dot \ + email git glsl go html ini inputrc java javascript json keymap \ + kickstart ledger lisp lua makefile man markdown mpdconf nanorc \ + nginx patch peg php pkgbuild pkg-config po privoxy properties \ + python rpmspec ruby sed shell sql systemd tex vala vi xml \ + xresources yaml yum + +MIXINS = $(wildcard mixins/*.nanorc) +FILES = $(addsuffix .nanorc, $(LANGS)) +ALL = $(addprefix build/, $(FILES)) build/ALL.nanorc +DIR = $(HOME)/.nano/syntax +THEME = theme.sed +FILTER = sed -f mixins.sed | sed -f $(THEME) + +all: $(ALL) + +build/ALL.nanorc: $(FILES) $(MIXINS) $(THEME) | build/ + @cat $(FILES) | $(FILTER) > $@ + @echo 'Generated: $@' + +build/%.nanorc: %.nanorc $(MIXINS) $(THEME) | build/ + @cat $< | $(FILTER) > $@ + @echo 'Generated: $@' + +build/: + @mkdir -p $@ + +install: all + @mkdir -p '$(DESTDIR)$(DIR)' + @install -p -m 0644 $(ALL) '$(DESTDIR)$(DIR)' + @echo 'Installed: $(DESTDIR)$(DIR)/*.nanorc' + +install-global: + @$(MAKE) --no-print-directory install DIR=/usr/local/share/nano + +clean: + rm -rf build + + +ifeq ($(shell test -f ~/.nanotheme && echo 1),1) + THEME = ~/.nanotheme +endif + +# Remove "header" directives if not supported (introduced in nano 2.1.6) +NANOVER = $(shell nano -V | sed -n 's/^.* version \([0-9\.]*\).*/\1/p') +ifeq ($(shell printf "2.1.5\n$(NANOVER)" | sort -nr | head -1),2.1.5) + FILTER += | sed -e '/^header/d' +endif + +ifdef TEXT + FILTER += | sed -e 's|^color \(bright\)\{0,1\}black|color \1$(TEXT)|' +endif + +ifdef BSDREGEX + FILTER += | sed -e 's|\\<|[[:<:]]|g;s|\\>|[[:>:]]|g' +endif + + +.PHONY: all install install-global clean force diff --git a/README.md b/README.md new file mode 100644 index 0000000..8bf45d6 --- /dev/null +++ b/README.md @@ -0,0 +1,148 @@ +Unmaintained +============ + +I am no longer using nano as my editor and hence have little motivation +to continue working on this project. It remains available on GitHub for +archival purposes only. + +Everything in the repository is in the Public Domain. Feel free to fork +it and/or use the files for any purpose. + +P.S. I highly recommend [dex](https://github.com/tihirvon/dex) as a +simple but much more capable editor. + + +------ + + +Description +----------- + +The syntax highlighting definitions that come bundled with nano are of +pretty poor quality. This is an attempt at providing a good set of accurate +syntax definitions to replace and expand the defaults. + +Installation +------------ + +Using `make install` will install the syntax definitions to the +`~/.nano/syntax/` directory. + +To enable highlighting for *all* languages after installation, add the +following command to your `~/.nanorc` file: + + include ~/.nano/syntax/ALL.nanorc + +To enable only a subset of languages, `include` them individually: + + include ~/.nano/syntax/c.nanorc + include ~/.nano/syntax/python.nanorc + include ~/.nano/syntax/sh.nanorc + # ... + +If you prefer to install to a location that all users can access, using +`sudo make install-global` will install to `/usr/local/share/nano/`. +Syntax files installed under this directory can then be `include`d in +either `/etc/nanorc` or any user's personal `~/.nanorc`. + +**Note**: If your terminal **text** color isn't black, you'll need to +specify it when installing, using `make install TEXT=color`, where +`color` must be one of: `red`, `green`, `yellow`, `blue`, `magenta`, +`cyan` or `white`. + +After installation, the various source code samples in the `examples` +directory can be used to check that highlighting is working correctly. +If it doesn't work as expected, see the FAQ below. + +Theme System +------------ + +All `*.nanorc` files are passed through [mixins.sed] and [theme.sed] before +installation. These scripts allow rules to be specified in terms of token +names or [mixins], instead of hard-coded colors. + +For example, the following named rule: + + TYPE: "int|bool|string" + +becomes: + + color green "int|bool|string" + +and the following "mixin": + + +BOOLEAN + +becomes: + + color brightcyan "\<(true|false)\>" + +This system helps to keep colors uniform across different languages and +also to keep the definitions clear and maintainable, which is something that +becomes quite awkward using only plain [nanorc] files. + +**Note:** if `~/.nanotheme` exists it will be used as a custom theme, in +place of [theme.sed]. A custom theme may also be specified by installing +with `make THEME=your-custom-theme.sed`. Themes must be valid sed scripts, +defining *all* color codes found in [theme.sed] in order to work correctly. + +FAQ +---- + +### Why does syntax highlighting only work for a subset of supported files? + +There appears to be a bug in older versions of nano that causes +highlighting to fail when `/etc/nanorc` and `~/.nanorc` both contain +`syntax` rules. The usual workaround is to remove all `syntax` and `include` +commands from one file or the other, or to use a newer version of nano. + +### Why do I get weird errors when running nano < 2.1.5 on *BSD systems? + +In order to reliably highlight keywords, this projects makes heavy use of +the GNU regex word boundary extensions (`\<` and `\>`). BSD implementations +also have these extensions but use a different, incompatible syntax +(`[[:<:]]` and `[[:>:]]`). Since version 2.1.5, nano can automatically +translate the GNU syntax to BSD syntax at run-time, but for the benefit of +people running a pre-2.1.5 version of nano on OS X or *BSD, the `.nanorc` +file itself can be translated by installing with `make BSDREGEX=1`. + +### Why not use `\s` instead of the verbose `[[:space:]]` pattern? + +Because nano compiles against the platform's native regex library and some +platforms don't support `\s` (as it's not required by POSIX [ERE]). + +Unlicense +--------- + +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to + + +[GNU nano]: http://www.nano-editor.org/ +[nanorc]: http://www.nano-editor.org/dist/v2.3/nanorc.5.html +[theme.sed]: https://github.com/nanorc/nanorc/tree/master/theme.sed +[mixins.sed]: https://github.com/nanorc/nanorc/tree/master/mixins.sed +[mixins]: https://github.com/nanorc/nanorc/tree/master/mixins +[ERE]: http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html#tag_09_04 diff --git a/awk.nanorc b/awk.nanorc new file mode 100644 index 0000000..a2ae6bd --- /dev/null +++ b/awk.nanorc @@ -0,0 +1,24 @@ +syntax "awk" "\.awk$" +header "^#!.*bin/(env +)?awk( |$)" + +VARIABLE: "\$[A-Za-z0-9_!@#$*?-]+" +VARIABLE: "\<(ARGC|ARGIND|ARGV|BINMODE|CONVFMT|ENVIRON|ERRNO|FIELDWIDTHS)\>" +VARIABLE: "\<(FILENAME|FNR|FS|IGNORECASE|LINT|NF|NR|OFMT|OFS|ORS)\>" +VARIABLE: "\<(PROCINFO|RS|RT|RSTART|RLENGTH|SUBSEP|TEXTDOMAIN)\>" +FUNCTION: "\<(function|extension|BEGIN|END)\>" +OPERATOR: "[-+*/%^|!=&<>?;:]|\\|\[|\]" +KEYWORD: "\<(for|if|while|do|else|in|delete|exit)\>" +KEYWORD: "\<(break|continue|return)\>" +FUNCTION: "\<(close|getline|next|nextfile|print|printf|system|fflush)\>" +FUNCTION: "\<(atan2|cos|exp|int|log|rand|sin|sqrt|srand)\>" +FUNCTION: "\<(asort|asorti|gensub|gsub|index|length|match)\>" +FUNCTION: "\<(split|sprintf|strtonum|sub|substr|tolower|toupper)\>" +FUNCTION: "\<(mktime|strftime|systime)\>" +FUNCTION: "\<(and|compl|lshift|or|rshift|xor)\>" +FUNCTION: "\<(bindtextdomain|dcgettext|dcngettext)\>" +REGEXP: "/.*[^\]/" ++STRING +ESCAPE: "\\." ++HASHCOMMENT ++TODO ++LINT diff --git a/c.nanorc b/c.nanorc new file mode 100644 index 0000000..e91ff95 --- /dev/null +++ b/c.nanorc @@ -0,0 +1,21 @@ +syntax "c" "\.(c(c|pp|xx)?|C)$" "\.(h(h|pp|xx)?|H)$" "\.ii?$" + ++FUNCTION +MACRO: "\<[A-Z_][0-9A-Z_]+\>" +TYPE: "\<(float|double|bool|char|int|short|long|void|(un)?signed)\>" +TYPE: "\<[a-z0-9_]+_t\>" +KEYWORD: "\<(struct|enum|static|const|union|typedef|extern)\>" +KEYWORD: "\<(for|if|while|do|else|case|default|switch)\>" +KEYWORD: "\<(return|inline|sizeof|auto|register|volatile|restrict)\>" +KEYWORD: "\<(try|throw|catch|operator|new|delete)\>" +JUMP: "\<(goto|break|continue)\>" ++BOOLEAN +OPERATOR: "[-+/*=<>?:!~%&|^]" +NUMBER: "\<([0-9]+|0x[0-9a-fA-F]*)\>|'.'" +MACRO: "^[[:space:]]*#[[:space:]]*(define|include(_next)?|(un|ifn?)def|endif|el(if|se)|if|warning|error|pragma)" +ATTRIBUTE: "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__" +STRING: ""(\\.|[^"])*"|<[A-Za-z_./-]+>" +ESCAPE: "\\([\"'abfnrtv\\]|[0-3]?[0-7]{1,2}|x[A-Fa-f0-9]{1,2}|$)" ++CCOMMENT ++TODO ++LINT diff --git a/cmake.nanorc b/cmake.nanorc new file mode 100644 index 0000000..8046b97 --- /dev/null +++ b/cmake.nanorc @@ -0,0 +1,9 @@ +syntax "cmake" "CMakeLists\.txt$|\.cmake$" + ++FUNCTION +BOOLEAN: "\<(ON|OFF|TRUE|FALSE|YES|NO)\>" +VARIABLE: "\$\{[A-Za-z0-9_!@#$*?-]+\}" ++STRING +ESCAPE: "\\([()#$^]|\\|\")" ++HASHCOMMENT ++LINT diff --git a/coffeescript.nanorc b/coffeescript.nanorc new file mode 100644 index 0000000..c2b4c0b --- /dev/null +++ b/coffeescript.nanorc @@ -0,0 +1,15 @@ +syntax "coffeescript" "\.coffee$" +header "^#!.*/(env +)?coffee" + +OPERATOR: "[!&|=/*+-<>]|\<(and|or|is|isnt|not)\>" +FUNCTION: "[A-Za-z_][A-Za-z0-9_]*:[[:space:]]*(->|\()" "->" +PLAIN: "[()]" +KEYWORD: "\<(for|of|continue|break|isnt|null|unless|this|else|if|return)\>" +KEYWORD: "\<(try|catch|finally|throw|new|delete|typeof|in|instanceof)\>" +KEYWORD: "\<(debugger|switch|while|do|class|extends|super)\>" +KEYWORD: "\<(undefined|then|unless|until|loop|of|by|when)\>" +BOOLEAN: "\<(true|false|yes|no|on|off)\>" +VARIABLE: "@[A-Za-z0-9_]*" ++STRING ++HASHCOMMENT ++LINT diff --git a/colortest.nanorc b/colortest.nanorc new file mode 100644 index 0000000..bf48aaf --- /dev/null +++ b/colortest.nanorc @@ -0,0 +1,17 @@ +syntax "colortest" "ColorTest$" + +color black "\" + +color red "\" +color green "\" +color yellow "\" +color blue "\" +color magenta "\" +color cyan "\" + +color brightred "\" +color brightgreen "\" +color brightyellow "\" +color brightblue "\" +color brightmagenta "\" +color brightcyan "\" diff --git a/csharp.nanorc b/csharp.nanorc new file mode 100644 index 0000000..fc181e3 --- /dev/null +++ b/csharp.nanorc @@ -0,0 +1,24 @@ +syntax "c#" "\.cs$" + +# Class +SECTION: "class +[A-Za-z0-9]+ *((:) +[A-Za-z0-9.]+)?" + +# Annotation +ESCAPE: "@[A-Za-z]+" + ++FUNCTION +TYPE: "\<(bool|byte|sbyte|char|decimal|double|float|IntPtr|int|uint|long|ulong|object|short|ushort|string|base|this|var|void)\>" +KEYWORD: "\<(alias|as|case|catch|checked|default|do|dynamic|else|finally|fixed|for|foreach|goto|if|is|lock|new|null|return|switch|throw|try|unchecked|while)\>" +KEYWORD: "\<(abstract|async|class|const|delegate|enum|event|explicit|extern|get|implicit|in|internal|interface|namespace|operator|out|override|params|partial|private|protected|public|readonly|ref|sealed|set|sizeof|stackalloc|static|struct|typeof|unsafe|using|value|virtual|volatile|yield)\>" +# LINQ-only keywords (ones that cannot be used outside of a LINQ query - lots others can) +KEYWORD: "\<(from|where|select|group|info|orderby|join|let|in|on|equals|by|ascending|descending)\>" +JUMP: "\<(break|continue)\>" ++BOOLEAN +OPERATOR: "[-+/*=<>?:!~%&|]" +NUMBER: "\<([0-9._]+|0x[A-Fa-f0-9_]+|0b[0-1_]+)[FL]?\>" ++STRING +ESCAPE: "\\([btnfr]|'|\"|\\)" +ESCAPE: "\\u[A-Fa-f0-9]{4}" ++CCOMMENT ++TODO ++LINT diff --git a/css.nanorc b/css.nanorc new file mode 100644 index 0000000..fc61728 --- /dev/null +++ b/css.nanorc @@ -0,0 +1,31 @@ +syntax "css" "\.s?css$" + +# Selectors +TYPE: "\<(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)\>" +OPERATOR: "[>+~*]" +VARIABLE: "[.#][A-Za-z_][A-Za-z0-9_-]*" +OPERATOR: ":(active|focus|hover|link|visited|first-child|lang|valid|invalid|not|selection)\>" +OPERATOR: ":(after|before|first-line|first-letter|root|target)\>" +STRING: "\[[^\[]*\]" +PLAIN: start="\{" end="\}" + +# Sass +SECTION: "(^|[[:space:]])@(include|mixin)\>" +VARIABLE: "\$[A-Za-z0-9_-]+" + +SECTION: "(^|[[:space:]])@(charset|font-face|media|page|import)\>" +OPERATOR: "[*]" +BOOLEAN: "\<(above|absolute|always|armenian|auto|avoid|baseline|behind|below|bidi-override|blink|block|bolder|bold|bottom|capitalize|center-left|center-right|center|circle|cjk-ideographic|close-quote|collapse|compact|condensed|continuous|crop|crosshair|cross|cue-after|cue-before|cursive|dashed|decimal|decimal-leading-zero|default|digits|disc|dotted|double|embed|e-resize|expanded|extra-condensed|extra-expanded|fantasy|far-left|far-right|faster|fast|fixed|fixed|georgian|groove|hebrew|help|hide|higher|high|hiragana-iroha|hiragana|inherit|inline|inline-block|inline-table|inset|inside|invert|italic|justify|katakana-iroha|katakana|landscape|large|larger|left|left-side|leftwards|level|lighter|line-through|list-item|loud|lower-alpha|lowercase|lower-greek|lower-latin|lower-roman|lower|low|ltr|marker|medium|medium|middle|mix|monospace|move|narrower|ne-resize|no-close-quote|none|no-open-quote|no-repeat|normal|nowrap|n-resize|nw-resize|oblique|once|open-quote|outset|outside|overline|pointer|portait|relative|repeat-x|repeat-y|repeat|ridge|right-side|right|rightwards|rlt|run-in|sans-serif|scroll|scroll|semi-condensed|semi-expanded|separate|se-resize|serif|show|silent|slower|slow|small-caps|smaller|small|soft|solid|spell-out|square|s-resize|static|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|text-bottom|text|text-top|thick|thin|top|top|transparent|ultra-condensed|ultra-expanded|underline|upper-alpha|uppercase|upper-latin|upper-roman|visible|wait|wider|w-resize|x-fast|x-high|x-large|x-loud|x-low|x-slow|x-small|x-soft|xx-large|xx-small|pre-wrap|break-word)([[:space:];,]|$)" +VARIABLE: ":[[:space:]]*(code|hidden|table|pre)\>" +KEYWORD: "\<(background-attachment|background-clip|background-color|background-image|background-position|background-repeat|background|border-bottom-color|border-bottom-style|border-bottom-width|border-bottom|border-collapse|border-color|border-left-color|border-left-style|border-left-width|border-left|border-radius|border-right-color|border-right-style|border-right-width|border-right|border-spacing|border-style|border-top-color|border-top-style|border-top-width|border-top|border-width|border|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|content|counter-increment|counter-reset|cue-after|cue-before|cue|cursor|direction|display|elevation|empty-cells|float|font-family|font-size-adjust|font-size|font-style|font-variant|font-weight|font|height|left|letter-spacing|line-height|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|marker-offset|marks|max-height|max-width|min-height|min-width|opacity|orphans|outline-color|outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page|pause-after|pause-before|pause|pitch-range|pitch|play-during|position|quotes|richness|right|size|speak-header|speak-numerical|speak-punctuation|speak|speech-rate|stress|table-layout|text-align|text-decoration|text-indent|text-shadow|text-transform|top|transition|unicode-bidi|vertical-align|visibility|voice-family|volume|white-space|widows|width|word-spacing|word-wrap|z-index)[[:space:]]*:" +WARNING: "-(ms|moz|apple|khtml|wap|webkit|o|xv)-[a-z][a-z-]+" +PLAIN: "[:;,]" +NUMBER: "\<(0|[\+-]?[1-9][0-9]*)" +NUMBER: "[\+-]?([0-9]+|[0-9]*\.[0-9]+)(%|e(m|x)|p(x|t|c)|in|ft|(m|c)m|k?Hz|deg|g?rad|m?s)" +NUMBER: "#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})\>" +OPERATOR: "\!important\>" +FUNCTION: "[a-z-]*(-[a-z]+)?\(" "\(|\)" ++STRING ++CCOMMENT ++TODO ++LINT diff --git a/cython.nanorc b/cython.nanorc new file mode 100644 index 0000000..df1c401 --- /dev/null +++ b/cython.nanorc @@ -0,0 +1,25 @@ +syntax "cython" "\.(pyx|pxd|pyi)$" + ++FUNCTION +KEYWORD: "\<(and|as|assert|break|class|continue|def|del|elif|else|except)\>" +KEYWORD: "\<(exec|finally|for|from|global|if|import|in|is|lambda|not|or)\>" +KEYWORD: "\<(pass|print|raise|return|try|while|with|yield|None)\>" +KEYWORD: "\<(DEF|ELIF|ELSE|IF)\>" + +KEYWORD: "\<(cp?def( inline)?|cimport|cppclass|ctypedef|extern|include)\>" +KEYWORD: "\<(namespace|property|struct)\>" +TYPE: "\<(bint|char|double|int|public|void|unsigned)\>" + +OPERATOR: "[.:;,+*|=!\%@<>/&-]" +MACRO: "@[A-Za-z0-9_]+" +SECTION: "__[A-Za-z0-9_]+__" +BOOLEAN: "\<(True|False)\>" ++STRING +STRING: "['][^']*[^\\][']" "[']{3}.*[^\\][']{3}" +STRING: "["][^"]*[^\\]["]" "["]{3}.*[^\\]["]{3}" +STRING: start=""""[^"]" end=""""" +STRING: start="'''[^']" end="'''" +ESCAPE: "\\.?" ++HASHCOMMENT ++TODO ++LINT diff --git a/default.nanorc b/default.nanorc new file mode 100644 index 0000000..8533a3b --- /dev/null +++ b/default.nanorc @@ -0,0 +1,2 @@ +syntax "default" ++LINT diff --git a/dot.nanorc b/dot.nanorc new file mode 100644 index 0000000..530f56c --- /dev/null +++ b/dot.nanorc @@ -0,0 +1,7 @@ +syntax "dot" "\.(dot|gv)$" + +KEYWORD: "\<(digraph|edge|graph|node|subgraph)\>" +ATTRIBUTE: "\<(arrowhead|arrowsize|arrowtail|bgcolor|center|color|constraint|decorateP|dir|distortion|fillcolor|fontcolor|fontname|fontsize|headclip|headlabel|height|labelangle|labeldistance|labelfontcolor|labelfontname|labelfontsize|label|layers|layer|margin|mclimit|minlen|name|nodesep|nslimit|ordering|orientation|pagedir|page|peripheries|port_label_distance|rankdir|ranksep|rank|ratio|regular|rotate|samehead|sametail|shapefile|shape|sides|size|skew|style|tailclip|taillabel|URL|weight|width)\>" +OPERATOR: "=|->|--" ++STRING ++CCOMMENT diff --git a/email.nanorc b/email.nanorc new file mode 100644 index 0000000..6cd564e --- /dev/null +++ b/email.nanorc @@ -0,0 +1,5 @@ +syntax "email" + +color magenta "^>([^>].*|$)" +color blue "^>>([^>].*|$)" +color green "^>>>.*" diff --git a/examples/C.c b/examples/C.c new file mode 100644 index 0000000..41acb84 --- /dev/null +++ b/examples/C.c @@ -0,0 +1,28 @@ +#include +#include + +#define MACRO 350 + +/* Function declaration */ +int main(void) +{ + // Boolean + bool result = 2 > 1 ? true : false; + + // String literal + char *somestring = "sadsdasd"; + + // Function call + int someinteger = floor(100 + MACRO); + + // Keywords + if (1 > 2) { + return 0; + } else if (2 == 2) { + goto finish; + } else { + return 2; + } +finish: + return 1; +} diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt new file mode 100644 index 0000000..d1c59d0 --- /dev/null +++ b/examples/CMakeLists.txt @@ -0,0 +1,17 @@ +PROJECT(example C) +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + +# Build options +OPTION(BUILD_EXAMPLES "Build examples" OFF) +OPTION(THREADSAFE "Build threadsafe" ON) + +FUNCTION(TARGET_OS_LIBRARIES target) + IF(WIN32) + TARGET_LINK_LIBRARIES(${target} ws2_32) + ELSEIF(CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)") + TARGET_LINK_LIBRARIES(${target} socket nsl) + ENDIF() + IF(THREADSAFE) + TARGET_LINK_LIBRARIES(${target} ${CMAKE_THREAD_LIBS_INIT}) + ENDIF() +ENDFUNCTION() diff --git a/examples/CSS.css b/examples/CSS.css new file mode 100644 index 0000000..79e2129 --- /dev/null +++ b/examples/CSS.css @@ -0,0 +1,14 @@ +/* Element/Class/ID selectors */ +body, .class, #id { + margin: 0; +} + +/* Pseudo-classes */ +a:hover, a:active { + outline: 0; +} + +/* Attribute selector */ +abbr[title] { + border-bottom: 1px dotted; +} diff --git a/examples/CSharp.cs b/examples/CSharp.cs new file mode 100644 index 0000000..d7bbdeb --- /dev/null +++ b/examples/CSharp.cs @@ -0,0 +1,11 @@ +using System; + +public class Hello { + public static void Main(string[] args) { + // Print command-line arguments + Console.WriteLine("You entered {0} arguments:", args.Length); + for (int i = 0; i < args.Length; i++) { + Console.WriteLine("{0}", args[i]); + } + } +} diff --git a/examples/ColorTest b/examples/ColorTest new file mode 100644 index 0000000..6852b57 --- /dev/null +++ b/examples/ColorTest @@ -0,0 +1,19 @@ +DEFAULT +PLAIN + +The first 2 lines of this file should be the same color. If they're not, +please read the "Installation" section of the README. + +red +green +yellow +blue +magenta +cyan + +brightred +brightgreen +brightyellow +brightblue +brightmagenta +brightcyan diff --git a/examples/Cython.pyx b/examples/Cython.pyx new file mode 100644 index 0000000..288998f --- /dev/null +++ b/examples/Cython.pyx @@ -0,0 +1,12 @@ +cdef class SinOfSquareFunction(Function): + cpdef double evaluate(self, double x) except *: + return sin(x**2) + +cdef inline int something_fast(int a, int b): + return a*a + b + +cdef double f(double x): + return sin(x**2) + +cdef class MyType: + cdef int field diff --git a/examples/DOT.dot b/examples/DOT.dot new file mode 100644 index 0000000..f84f9b1 --- /dev/null +++ b/examples/DOT.dot @@ -0,0 +1,10 @@ +graph graphname { + // The label attribute can be used to change the label of a node + a [label="Foo"]; + // Here, the node shape is changed. + b [shape=box]; + // These edges both have different line properties + a -- b -- c [color=blue]; + b -- d [style=dotted]; + c -- d[style=dotted] +} diff --git a/examples/GLSL.glsl b/examples/GLSL.glsl new file mode 100644 index 0000000..1f349cc --- /dev/null +++ b/examples/GLSL.glsl @@ -0,0 +1,18 @@ +// GLSL syntax example +void main() { + vec3 normal, lightDir; + vec4 diffuse, ambient, globalAmbient; + float NdotL; + + normal = normalize(gl_NormalMatrix * gl_Normal); + lightDir = normalize(vec3(gl_LightSource[0].position)); + NdotL = max(dot(normal, lightDir), 0.0); + diffuse = gl_FrontMaterial.diffuse * gl_LightSource[0].diffuse; + + ambient = gl_FrontMaterial.ambient * gl_LightSource[0].ambient; + globalAmbient = gl_LightModel.ambient * gl_FrontMaterial.ambient; + + gl_FrontColor = NdotL * diffuse + globalAmbient + ambient; + + gl_Position = ftransform(); +} diff --git a/examples/Go.go b/examples/Go.go new file mode 100644 index 0000000..0babfdd --- /dev/null +++ b/examples/Go.go @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + "math" +) + +type Vertex struct { + X, Y float64 +} + +func (v *Vertex) Scale(f float64) { + v.X = v.X * f + v.Y = v.Y * f +} + +func (v *Vertex) Abs() float64 { + return math.Sqrt(v.X*v.X + v.Y*v.Y) +} + +func main() { + v := &Vertex{3, 4} + v.Scale(5) + fmt.Println(v, v.Abs()) +} diff --git a/examples/HTML.html b/examples/HTML.html new file mode 100644 index 0000000..0049788 --- /dev/null +++ b/examples/HTML.html @@ -0,0 +1,22 @@ + + + + + nano Syntax Highlighting Example + + + +

Heading

+
    +
  1. List Item
  2. + +
+ Warning for non-standard elements + + {% block django_template %}{{ value }}{% endblock %} + + + + diff --git a/examples/INI.ini b/examples/INI.ini new file mode 100644 index 0000000..7387f72 --- /dev/null +++ b/examples/INI.ini @@ -0,0 +1,8 @@ +[Section 1] +key = value +foo = false + +# Comment +[Section 2] +etc = "a quoted string" +num = 100 diff --git a/examples/JSON.json b/examples/JSON.json new file mode 100644 index 0000000..fc78ff4 --- /dev/null +++ b/examples/JSON.json @@ -0,0 +1,16 @@ +{ + "application": { + "window": { + "name": "main_window", + "width": 500, + "height": 500, + "visible": true, + "tag": null + }, + "text": { + "size": 36, + "style": "bold", + "name": "text1" + } + } +} diff --git a/examples/Java.java b/examples/Java.java new file mode 100644 index 0000000..3561f06 --- /dev/null +++ b/examples/Java.java @@ -0,0 +1,6 @@ +// Hello world in Java +class HelloWorldApp { + public static void main(String[] args) { + System.out.println("Hello World!"); + } +} diff --git a/examples/Lua.lua b/examples/Lua.lua new file mode 100644 index 0000000..9b3e705 --- /dev/null +++ b/examples/Lua.lua @@ -0,0 +1,21 @@ +#!/usr/bin/lua +-- Lua syntax example + +function example(x) + for k, v in pairs(x) do + local r + if type(v) == "string" then + r = v .. " World" + elseif not v or v == 0xbada55 * 10 then + r = nil + break + else + r = false + end + print(r) + end + return true +end + +local t = {a="Hello", b=9, c=false} +example(t) diff --git a/examples/Properties.properties b/examples/Properties.properties new file mode 100644 index 0000000..9fe0193 --- /dev/null +++ b/examples/Properties.properties @@ -0,0 +1,19 @@ +! This isn't a typical or pretty example of a properties file -- it's +! more an example of how edge cases and character escapes are handled + +# Colon escape: +website = http\://en.wikipedia.org/ +language = English + +# Newline escape: +message = Hello, \ + World + +! Colon delimiter and Unicode escape: +tab : \u0009 + +# Space delimiter with escaped space in key: +key\ name value + +# Equals sign in key: +foo\=bar = foobar diff --git a/examples/Python.py b/examples/Python.py new file mode 100644 index 0000000..2beec09 --- /dev/null +++ b/examples/Python.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python +# encoding: utf-8 + +class Foo(): + def __init__(self, name = "World!"): + self.name = name + +if __name__ == "__main__": + instance = Foo() + print "Hello, %s" % instance.name +# print "Mixing tabs and spaces is bad" diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 0000000..da1f463 --- /dev/null +++ b/examples/README.md @@ -0,0 +1,21 @@ +Examples +======== + +This directory contains various example files for quickly viewing and +testing [nanorc][1] syntax definitions. + +[1]: http://www.nano-editor.org/dist/v2.3/nanorc.5.html "nanorc man page" + +List Example +------------ + +- List item +- **Bold list item** +- [Linked list item](http://example.org "Example Link") + +Code Example +------------ + + for i in A B C D; do + echo $i + done diff --git a/examples/Scheme.scm b/examples/Scheme.scm new file mode 100644 index 0000000..5910666 --- /dev/null +++ b/examples/Scheme.scm @@ -0,0 +1,13 @@ +;; A simple counter +(let loop ((n 1)) + (if (<= n 10) + (begin + (display n)(newline) + (loop (+ n 1))))) + +;; Tabulation of squares from 0 to 9 +(let loop ((i 0)) + (if (not (= i 10)) + (begin + (display i)(display " squared = ")(display (* i i))(newline) + (loop (+ i 1))))) diff --git a/examples/git-rebase-todo b/examples/git-rebase-todo new file mode 100644 index 0000000..3efe501 --- /dev/null +++ b/examples/git-rebase-todo @@ -0,0 +1,15 @@ +pick 1fc6c95 Patch A +squash fa39187 Something to add to patch A +pick 7b36971 Something to move before patch B +pick 6b2481b Patch B +fixup c619268 A fix for Patch B +edit dd1475d Something I want to split +reword 4ca2acc i cant' typ goods + +# Commands: +# p, pick = use commit +# r, reword = use commit, but edit the commit message +# e, edit = use commit, but stop for amending +# s, squash = use commit, but meld into previous commit +# f, fixup = like "squash", but discard this commit's log message +# x, exec = run command (the rest of the line) using shell diff --git a/git.nanorc b/git.nanorc new file mode 100644 index 0000000..25df941 --- /dev/null +++ b/git.nanorc @@ -0,0 +1,18 @@ +syntax "gitconfig" "git(config|modules)$|\.git/config$" + ++BOOLEAN ++INI ++STRING ++HASHCOMMENT ++LINT + +syntax "git-editmsg" "(COMMIT|TAG)_EDITMSG$" + +COMMENT: "^#.*$" +color ,red "[[:space:]]+$" + +syntax "git-rebase" "git-rebase-todo$" + +KEYWORD: "^(edit|fixup|pick|reword|squash|exec|[efprsx])\>" +NUMBER: "\<[0-9a-f]{7,40}\>" +COMMENT: "^#.*" diff --git a/glsl.nanorc b/glsl.nanorc new file mode 100644 index 0000000..37249d2 --- /dev/null +++ b/glsl.nanorc @@ -0,0 +1,13 @@ +syntax "glsl" "\.(frag|vert|fp|vp|glsl)$" + ++FUNCTION +TYPE: "\<(void|bool|bvec2|bvec3|bvec4|int|ivec2|ivec3|ivec4|float|vec2|vec3|vec4|mat2|mat3|mat4|struct|sampler1D|sampler2D|sampler3D|samplerCUBE|sampler1DShadow|sampler2DShadow)\>" +TYPE: "\" +KEYWORD: "\<(const|attribute|varying|uniform|in|out|inout|if|else|return|discard|while|for|do)\>" +JUMP: "\<(break|continue)\>" ++BOOLEAN +OPERATOR: "[-+/*=<>?:!~%&|^]" +NUMBER: "\<([0-9]+|0x[0-9a-fA-F]*)\>" ++CCOMMENT ++TODO ++LINT diff --git a/go.nanorc b/go.nanorc new file mode 100644 index 0000000..9ed5058 --- /dev/null +++ b/go.nanorc @@ -0,0 +1,20 @@ +syntax "go" "\.go$" + ++FUNCTION +FUNCTION: "\<(append|cap|close|complex|copy|delete|imag|len)\>" +FUNCTION: "\<(make|new|panic|print|println|protect|real|recover)\>" +TYPE: "\<(u?int(8|16|32|64)?|float(32|64)|complex(64|128))\>" +TYPE: "\<(uintptr|byte|rune|string|interface|bool|map|chan|error)\>" +KEYWORD: "\<(package|import|const|var|type|struct|func|go|defer|nil|iota)\>" +KEYWORD: "\<(for|range|if|else|case|default|switch|return)\>" +JUMP: "\<(go|goto|break|continue)\>" ++BOOLEAN +OPERATOR: "[-+/*=<>!~%&|^]|:=" +NUMBER: "\<([0-9]+|0x[0-9a-fA-F]*)\>|'.'" ++STRING +ESCAPE: "\\[abfnrtv'\"\\]" +ESCAPE: "\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})" +STRING: "`[^`]*`" ++CCOMMENT ++TODO ++LINT diff --git a/html.nanorc b/html.nanorc new file mode 100644 index 0000000..8cdbe18 --- /dev/null +++ b/html.nanorc @@ -0,0 +1,22 @@ +syntax "html" "\.html?$" +header "" +WARNING: "]" +TAG: "]" +STRING: "=([A-Za-z0-9!$%*\^(){}#|:;_~@+,.?/\\-]|\[|\])+" +OPERATOR: "=" ++STRING +PLAIN: start=">" end="<" +TAG: "[<>]" + +# Embedded template languages +VARIABLE: "\{\{[^}]*\}\}|<%=.*%>" +FUNCTION: start="<\?" end="\?>" +FUNCTION: start="<%[^=]" end="%>" +FUNCTION: start="\{%" end="%\}" + +ESCAPE: "&(#[0-9]+|#x[0-9a-fA-F]+|[A-Za-z][A-Za-z0-9]*);" +COMMENT: start="" +COMMENT: "]*>" ++LINT diff --git a/ini.nanorc b/ini.nanorc new file mode 100644 index 0000000..fbd56f9 --- /dev/null +++ b/ini.nanorc @@ -0,0 +1,9 @@ +syntax "ini" "\.(ini|desktop|lfl|override)$" "(mimeapps\.list|pinforc|setup\.cfg)$" "weechat/.+\.conf$" +header "^\[[A-Za-z]+\]$" + ++BOOLEAN ++INI +OPERATOR: "[=;]" ++STRING ++HASHCOMMENT ++LINT diff --git a/inputrc.nanorc b/inputrc.nanorc new file mode 100644 index 0000000..5cfb2e6 --- /dev/null +++ b/inputrc.nanorc @@ -0,0 +1,9 @@ +syntax "inputrc" "inputrc$" + +color red "\<(off|none)\>" +color green "\" +FUNCTION: "\" ++STRING +ESCAPE: "\\.?" ++HASHCOMMENT ++LINT diff --git a/java.nanorc b/java.nanorc new file mode 100644 index 0000000..7c586ef --- /dev/null +++ b/java.nanorc @@ -0,0 +1,25 @@ +syntax "java" "\.java$" + +# Class +SECTION: "class +[A-Za-z0-9]+ *((implements|extends) +[A-Za-z0-9.]+)?" + +# Annotation +ESCAPE: "@[A-Za-z]+" + ++FUNCTION +TYPE: "\<(boolean|byte|char|double|float|int|long|short|String|void)\>" +KEYWORD: "\<(case|catch|default|do|else|finally|for|if)\>" +KEYWORD: "\<(new|return|switch|this|throw|transient|try|while)\>" +KEYWORD: "\<(abstract|class|extends|final|implements|import|instanceof)\>" +KEYWORD: "\<(interface|native|package|private|protected|public|static)\>" +KEYWORD: "\<(strictfp|super|synchronized|throws|volatile|null)\>" +JUMP: "\<(break|continue)\>" ++BOOLEAN +OPERATOR: "[-+/*=<>?:!~%&|]" +NUMBER: "\<([0-9._]+|0x[A-Fa-f0-9_]+|0b[0-1_]+)[FL]?\>" ++STRING +ESCAPE: "\\([btnfr]|'|\"|\\)" +ESCAPE: "\\u[A-Fa-f0-9]{4}" ++CCOMMENT ++TODO ++LINT diff --git a/javascript.nanorc b/javascript.nanorc new file mode 100644 index 0000000..0de8df3 --- /dev/null +++ b/javascript.nanorc @@ -0,0 +1,20 @@ +syntax "JavaScript" "\.js$" + +NUMBER: "\<[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\>" +NUMBER: "\<[-+]?([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?" +NUMBER: "\<[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?" ++FUNCTION +KEYWORD: "\<(break|case|catch|continue|default|delete|do|else|finally)\>" +KEYWORD: "\<(for|function|get|if|in|instanceof|new|return|set|switch)\>" +KEYWORD: "\<(switch|this|throw|try|typeof|var|void|while|with)\>" +KEYWORD: "\<(null|undefined|NaN)\>" ++BOOLEAN +TYPE: "\<(Array|Boolean|Date|Enumerator|Error|Function|Math)\>" +TYPE: "\<(Number|Object|RegExp|String)\>" +OPERATOR: "[-+/*=<>!~%?:&|]" +REGEXP: "/[^*]([^/]|(\\/))*[^\\]/[gim]*" ++STRING +ESCAPE: "\\[0-7][0-7]?[0-7]?|\\x[0-9a-fA-F]+|\\[bfnrt'"\?\\]" ++CCOMMENT ++TODO ++LINT diff --git a/json.nanorc b/json.nanorc new file mode 100644 index 0000000..ab45372 --- /dev/null +++ b/json.nanorc @@ -0,0 +1,10 @@ +syntax "json" "\.json$" +header "^\{$" + +NUMBER: "\<[-]?[1-9][0-9]*([Ee][+-]?[0-9]+)?\>" "\<[-]?[0](\.[0-9]+)?\>" +KEYWORD: "\" ++BOOLEAN ++STRING +VARIABLE: "\"(\\"|[^"])*\"[[:space:]]*:" "'(\'|[^'])*'[[:space:]]*:" +ESCAPE: "\\u[0-9a-fA-F]{4}|\\[bfnrt'"/\\]" ++LINT diff --git a/keymap.nanorc b/keymap.nanorc new file mode 100644 index 0000000..08eb53f --- /dev/null +++ b/keymap.nanorc @@ -0,0 +1,9 @@ +syntax "keymap" "\.(k|key)?map$|Xmodmap$" + +KEYWORD: "\<(add|clear|compose|keycode|keymaps|keysym|remove|string)\>" +KEYWORD: "\<(control|alt|shift)\>" +NUMBER: "\<[0-9]+\>" +OPERATOR: "=" ++STRING +COMMENT: "^!.*$" ++LINT diff --git a/kickstart.nanorc b/kickstart.nanorc new file mode 100644 index 0000000..c0dd07e --- /dev/null +++ b/kickstart.nanorc @@ -0,0 +1,14 @@ +syntax "KickStart" "\.ks$" "\.kickstart$" + +SECTION: "%[a-z]+" +KEYWORD: "^[[:space:]]*(install|cdrom|text|graphical|volgroup|logvol|reboot|timezone|lang|keyboard|authconfig|firstboot|rootpw|user|firewall|selinux|repo|part|partition|clearpart|bootloader)" +KEYWORD: "--(name|mirrorlist|baseurl|utc)(=|\>)" +VARIABLE: "\$(releasever|basearch)\>" + +# Packages and groups +color brightblack "^@[A-Za-z][A-Za-z-]*" +color brightred "^-@[a-zA-Z0-9*-]+" +color red "^-[a-zA-Z0-9*-]+" + ++HASHCOMMENT ++LINT diff --git a/ledger.nanorc b/ledger.nanorc new file mode 100644 index 0000000..bc198fa --- /dev/null +++ b/ledger.nanorc @@ -0,0 +1,9 @@ +syntax "ledger" "(^|\.|/)ledger$" + +SECTION: "^([0-9]{4}/[0-9]{2}/[0-9]{2}|[=~]) .*" +NUMBER: "^[0-9]{4}/[0-9]{2}/[0-9]{2}" +VARIABLE: "^~ .*" +FUNCTION: "^= .*" +KEYWORD: "^[[:space:]]+\(?[A-Za-z ]+(:[A-Za-z ]+)*\)?" +OPERATOR: "[*]" +COMMENT: "^[[:space:]]*;.*" diff --git a/lisp.nanorc b/lisp.nanorc new file mode 100644 index 0000000..54f8c16 --- /dev/null +++ b/lisp.nanorc @@ -0,0 +1,13 @@ +syntax "lisp" "(emacs|zile)$" "\.(el|li?sp|scm|ss)$" + +FUNCTION: "\([a-z-]+" +OPERATOR: "\(([-+*/<>]|<=|>=)|'" +PLAIN: "\(" +NUMBER: "\<[0-9]+\>" +~KEYWORD: "\" +BOOLEAN: "\<[tT]\>" +STRING: "\"(\\.|[^"])*\"" +ESCAPE: "'[A-Za-z][A-Za-z0-9_-]+" +ESCAPE: "\\.?" +COMMENT: "(^|[[:space:]]);.*" ++LINT diff --git a/lua.nanorc b/lua.nanorc new file mode 100644 index 0000000..f6b4c3e --- /dev/null +++ b/lua.nanorc @@ -0,0 +1,22 @@ +syntax "lua" "\.lua$" +header "^#!.*lua(jit)?$" + +FUNCTION: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*([({'"]|\[=*\[)" +KEYWORD: "\<(do|end|while|repeat|until|if|elseif|then|else)\>" +KEYWORD: "\<(for|in|function|local|return|nil)\>" +JUMP: "\<(goto|break)\>" ++BOOLEAN +OPERATOR: "[-+:*/%^=#<>]|~=|\.\.|\[|\]|\<(not|and|or)\>" +WARNING: "[`!@$&|?]|!=" +PLAIN: "\.{3,}|[({'"]" +NUMBER: "\<([0-9]+)(\.[0-9]+)?([Ee][+-]?[0-9]+)?\>|0x[0-9a-fA-F]*" +SECTION: "::[A-Za-z_][A-Za-z0-9_]*::" ++STRING +ESCAPE: "\\([0-9]{1,3}|x[A-Fa-f0-9]{2}|[abefntrv'"\\]|\[|\])" +STRING: start="\[\[" end="\]\]" +STRING: start="\[=\[" end="\]=\]" +STRING: start="\[==\[" end="\]==\]" +COMMENT: "^#!.*" "(^|[[:space:]])\-\-.*$" +COMMENT: start="\-\-\[\[" end="\]\]" ++TODO ++LINT diff --git a/makefile.nanorc b/makefile.nanorc new file mode 100644 index 0000000..c020a7d --- /dev/null +++ b/makefile.nanorc @@ -0,0 +1,22 @@ +syntax "makefile" "([Mm]akefile|\.ma?k)$" +header "^#!.*/(env +)?[bg]?make( |$)" + +KEYWORD: "\<(ifeq|ifdef|ifneq|ifndef|else|endif)\>" +KEYWORD: "^(export|include|override)\>" +SECTION: "^[^:= ]+:" +OPERATOR: "[=,%]" "\+=|\?=|:=|&&|\|\|" +FUNCTION: "\$\((abspath|addprefix|addsuffix|and|basename|call|dir)[[:space:]]" +FUNCTION: "\$\((error|eval|filter|filter-out|findstring|firstword)[[:space:]]" +FUNCTION: "\$\((flavor|foreach|if|info|join|lastword|notdir|or)[[:space:]]" +FUNCTION: "\$\((origin|patsubst|realpath|shell|sort|strip|suffix)[[:space:]]" +FUNCTION: "\$\((value|warning|wildcard|word|wordlist|words)[[:space:]]" +PLAIN: "[()$]" ++STRING +VARIABLE: "\$+(\{[^} ]+\}|\([^) ]+\))" +VARIABLE: "\$[@^<*?%|+]|\$\([@^<*?%+-][DF]\)" +ESCAPE: "\$\$|\\.?" ++HASHCOMMENT +COMMENT: "^ @#.*" + +# Show trailing whitespace +color ,green "[[:space:]]+$" diff --git a/man.nanorc b/man.nanorc new file mode 100644 index 0000000..16d1907 --- /dev/null +++ b/man.nanorc @@ -0,0 +1,8 @@ +syntax "man" "\.[1-9]x?$" + +SECTION: "\.(S|T)H.*$" +KEYWORD: "\.(BR?|I[PR]?).*$" +MACRO: "\.(S|T)H|\.TP|\.(BR?|I[PR]?|PP)|\\f[BIPR]" ++STRING +STRING: "\.(br|DS|RS|RE|PD)" ++LINT diff --git a/markdown.nanorc b/markdown.nanorc new file mode 100644 index 0000000..c4962c4 --- /dev/null +++ b/markdown.nanorc @@ -0,0 +1,17 @@ +syntax "markdown" "\.(md|mkd|mkdn|markdown)$" + +# Emphasis +color green "(^|[[:space:]])(_[^ ][^_]*_|\*[^ ][^*]*\*)" + +# Strong emphasis +color brightgreen "(^|[[:space:]])(__[^ ][^_]*__|\*\*[^ ][^*]*\*\*)" + +SECTION: "^=====*$|^-----*$|^#{1,6}.*" +NUMBER: "^[[:space:]]*[\*+-] |^[[:space:]]*[0-9]+\. " +PLAIN: "^[[:space:]]+" +ESCAPE: "\(([CcRr]|[Tt][Mm])\)" "\.{3}" "(^|[[:space:]])\-\-($|[[:space:]])" +VARIABLE: "\!?\[[^]]*\]([[:space:]]*\[[^]]*\]|\(.*\))?" +VARIABLE: "^\[.*\]:[[:space:]]*[^"]*" +STRING: "`[^`]*`|^ {4}[^-+*].*" +COMMENT: "^>.*" ++LINT diff --git a/mixins.sed b/mixins.sed new file mode 100644 index 0000000..19743f9 --- /dev/null +++ b/mixins.sed @@ -0,0 +1,36 @@ +/^+STRING/ { + r mixins/string.nanorc + d +} +/^+BOOLEAN/ { + r mixins/boolean.nanorc + d +} +/^+FUNCTION/ { + r mixins/function.nanorc + d +} +/^+CCOMMENT/ { + r mixins/ccomment.nanorc + d +} +/^+HASHCOMMENT/ { + r mixins/hashcomment.nanorc + d +} +/^+INI/ { + r mixins/ini.nanorc + d +} +/^+TODO/ { + r mixins/todo.nanorc + d +} +/^+LINT/ { + r mixins/lint.nanorc + d +} +/^+LONGLINE/ { + r mixins/longline.nanorc + d +} diff --git a/mixins/boolean.nanorc b/mixins/boolean.nanorc new file mode 100644 index 0000000..7ec81c8 --- /dev/null +++ b/mixins/boolean.nanorc @@ -0,0 +1 @@ +BOOLEAN: "\<(true|false)\>" diff --git a/mixins/ccomment.nanorc b/mixins/ccomment.nanorc new file mode 100644 index 0000000..73d4c43 --- /dev/null +++ b/mixins/ccomment.nanorc @@ -0,0 +1,2 @@ +COMMENT: "(^|[[:space:]])//.*" +COMMENT: start="/\*" end="\*/" diff --git a/mixins/function.nanorc b/mixins/function.nanorc new file mode 100644 index 0000000..7e28274 --- /dev/null +++ b/mixins/function.nanorc @@ -0,0 +1,2 @@ +FUNCTION: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]" +PLAIN: "[(]" diff --git a/mixins/hashcomment.nanorc b/mixins/hashcomment.nanorc new file mode 100644 index 0000000..668f271 --- /dev/null +++ b/mixins/hashcomment.nanorc @@ -0,0 +1 @@ +COMMENT: "(^|[[:space:]])#([^{].*)?$" diff --git a/mixins/ini.nanorc b/mixins/ini.nanorc new file mode 100644 index 0000000..77d481e --- /dev/null +++ b/mixins/ini.nanorc @@ -0,0 +1,2 @@ +KEYWORD: "^[[:space:]]*[^=]*=" +SECTION: "^[[:space:]]*\[.*\]$" diff --git a/mixins/lint.nanorc b/mixins/lint.nanorc new file mode 100644 index 0000000..b90d75d --- /dev/null +++ b/mixins/lint.nanorc @@ -0,0 +1,3 @@ +color ,green "[[:space:]]+$" +color ,red " + +| + +" +# +EXTRALINT diff --git a/mixins/longline.nanorc b/mixins/longline.nanorc new file mode 100644 index 0000000..1ec892c --- /dev/null +++ b/mixins/longline.nanorc @@ -0,0 +1 @@ +WARNING: "^.{81,}$" diff --git a/mixins/string.nanorc b/mixins/string.nanorc new file mode 100644 index 0000000..9b4ff7b --- /dev/null +++ b/mixins/string.nanorc @@ -0,0 +1 @@ +STRING: ""(\\.|[^"])*"|'(\\.|[^'])*'" diff --git a/mixins/todo.nanorc b/mixins/todo.nanorc new file mode 100644 index 0000000..9cf09aa --- /dev/null +++ b/mixins/todo.nanorc @@ -0,0 +1 @@ +color brightwhite,cyan "TODO:?" diff --git a/mpdconf.nanorc b/mpdconf.nanorc new file mode 100644 index 0000000..6164d2e --- /dev/null +++ b/mpdconf.nanorc @@ -0,0 +1,8 @@ +syntax "mpdconf" "mpd\.conf$" + +KEYWORD: "\<(user|group|bind_to_address|host|port|plugin|name|type)\>" +KEYWORD: "\<((music|playlist)_directory|(db|log|state|pid|sticker)_file)\>" +SECTION: "^(input|audio_output|decoder)[[:space:]]*\{|\}" ++STRING ++HASHCOMMENT ++LINT diff --git a/nanorc.nanorc b/nanorc.nanorc new file mode 100644 index 0000000..7135578 --- /dev/null +++ b/nanorc.nanorc @@ -0,0 +1,18 @@ +syntax "nanorc" "nanorc$" +header "^syntax +\"" + +TYPE: "^i?color[[:space:]]*(bright)?(white|black|red|blue|green|yellow|magenta|cyan)?(,(white|black|red|blue|green|yellow|magenta|cyan))?\>" +KEYWORD: "^(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|poslog|preserve|punct)\>" "^[[:space:]]*(set|unset)[[:space:]]+(quickblank|quotestr|rebinddelete|rebindkeypad|regexp|smarthome|smooth|softwrap|speller|suspend|suspendenable|tabsize|tabstospaces|tempfile|undo|view|whitespace|wordbounds)\>" +KEYWORD: "^(bind|i?color|set|unset|syntax|header|magic)\>" +color red "^unbind\>" +KEYWORD: "^i?color\>" "\<(start|end)=" +MACRO: "^include\>" + +KEYWORD: "^(PLAIN|TYPE|STRING|MACRO|NUMBER|VARIABLE|OPERATOR|~?KEYWORD):" +KEYWORD: "^(BOOLEAN|SECTION|REGEXP|FUNCTION|ESCAPE|COMMENT|WARNING|JUMP):" +KEYWORD: "^(TAG|ATTRIBUTE):" +MACRO: "^\+(TODO|LINT|STRING|BOOLEAN|FUNCTION|INI|(C|HASH)COMMENT)$" + +ESCAPE: "\\.?" ++HASHCOMMENT ++LINT diff --git a/nginx.nanorc b/nginx.nanorc new file mode 100644 index 0000000..5948b30 --- /dev/null +++ b/nginx.nanorc @@ -0,0 +1,13 @@ +syntax "nginx" "nginx.*\.conf$" "\.nginx$" +header "^(server|upstream)[a-z ]*\{$" + +SECTION: "\<(events|server|http|location|upstream)[[:space:]]*\{" +KEYWORD: "(^|[[: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:]]|$)" +PLAIN: "[{}]" +BOOLEAN: "\<(on|off)\>" +VARIABLE: "\$[A-Za-z][A-Za-z0-9_]*" +OPERATOR: "[*]" ++STRING +STRING: start="'$" end="';$" ++HASHCOMMENT ++LINT diff --git a/patch.nanorc b/patch.nanorc new file mode 100644 index 0000000..60b6f8d --- /dev/null +++ b/patch.nanorc @@ -0,0 +1,9 @@ +syntax "patch" "\.(patch|diff)$" + +color brightgreen "^\+.*" +color green "^\+\+\+.*" +color brightred "^-.*" +color red "^---.*" +color blue "^@@.*" +color magenta "^diff.*" + diff --git a/peg.nanorc b/peg.nanorc new file mode 100644 index 0000000..01a04a5 --- /dev/null +++ b/peg.nanorc @@ -0,0 +1,11 @@ +syntax "peg" "\.l?peg$" + +KEYWORD: "^[[:space:]]*[A-Za-z][A-Za-z0-9_]*[[:space:]]*<-" +NUMBER: "\^[+-]?[0-9]+" +OPERATOR: "[-+*?^/!&]|->|<-|=>" +MACRO: "%[A-Za-z][A-Za-z0-9_]*" +REGEXP: "\[[^]]*\]" ++STRING +COMMENT: "(^|[[:space:]])\-\-.*$" ++TODO ++LINT diff --git a/php.nanorc b/php.nanorc new file mode 100644 index 0000000..2a3b6d2 --- /dev/null +++ b/php.nanorc @@ -0,0 +1,16 @@ +syntax "php" "\.php[2345s~]?$" +header "^(//|/\*).*[Pp][Hh][Pp]|<\?php\>" + +OPERATOR: "[-+/*=<>?:!~%&|]" +SECTION: "(<\?(php)?|\?>)" ++FUNCTION +TYPE: "\<(float|global|double|bool|char|int|enum|const)\>" +KEYWORD: "\<(class|new|private|public|function|for|foreach|if|while|do|var)\>" +KEYWORD: "\<(return|else|elseif|case|default|switch)\>" +JUMP: "\<(goto|break|continue)\>" ++BOOLEAN ++STRING +VARIABLE: "\$[A-Za-z_][A-Za-z0-9_]*" ++CCOMMENT ++TODO ++LINT diff --git a/pkg-config.nanorc b/pkg-config.nanorc new file mode 100644 index 0000000..e504546 --- /dev/null +++ b/pkg-config.nanorc @@ -0,0 +1,7 @@ +syntax "pkg-config" "\.pc$" + +KEYWORD: "^(Name|Description|URL|Version|Conflicts|Cflags):" +KEYWORD: "^(Requires|Libs)(\.private)?:" +OPERATOR: "=" +VARIABLE: "\$\{[A-Za-z_][A-Za-z0-9_]*\}" ++LINT diff --git a/pkgbuild.nanorc b/pkgbuild.nanorc new file mode 100644 index 0000000..4f1490a --- /dev/null +++ b/pkgbuild.nanorc @@ -0,0 +1,21 @@ +syntax "pkgbuild" "PKGBUILD$" "\.install$" + +FUNCTION: "^[A-Za-z0-9_+-]+[[:space:]]*\(\)" +KEYWORD: "\<(case|do|done|elif|else|esac|fi|for|function|if)\>" +KEYWORD: "\<(in|select|then|time|until|while)\>" +FUNCTION: "\<(echo|exit|export|let|local|read|return|set|shift|umask|unset)\>" +TYPE: "\<(pkgname|pkgver|pkgrel|epoch|pkgdesc|arch|url|license)\>" +TYPE: "\<(groups|depends|makedepends|checkdepends|optdepends)\>" +TYPE: "\<(provides|conflicts|replaces|backup|options|^install)\>" +TYPE: "\<(changelog|source|noextract)\>" +TYPE: "\<(md5sums|sha1sums|sha256sums|sha384sums|sha512sums)\>" +TYPE: "\<(srcdir|pkgdir)\>" +MACRO: "\<(strip|docs|libtool|emptydirs|zipman|purge|upx)\>" +MACRO: "\<(ccache|distcc|buildflags|makeflags)\>" +OPERATOR: "[{}()<>!=&|;`$]|\\|\[|\]|-(eq|ne|gt|lt|ge|le|s|n|z)\>" +STRING: ""(\\.|[^"])*"" +VARIABLE: "\$\{?[A-Za-z0-9_!@#$*?-]+\}?|`[^`]*`" +STRING: "'(\\.|[^'])*'" +ESCAPE: "\\.?" ++HASHCOMMENT ++LINT diff --git a/po.nanorc b/po.nanorc new file mode 100644 index 0000000..81d1a22 --- /dev/null +++ b/po.nanorc @@ -0,0 +1,7 @@ +syntax "po" "\.pot?$" + +KEYWORD: "\<(msgid|msgstr)\>" ++STRING +ESCAPE: "\\.?" ++HASHCOMMENT ++LINT diff --git a/privoxy.nanorc b/privoxy.nanorc new file mode 100644 index 0000000..0d7844c --- /dev/null +++ b/privoxy.nanorc @@ -0,0 +1,26 @@ +syntax "privoxy-config" "privoxy/config$" + +KEYWORD: "(accept-intercepted-requests|actionsfile|admin-address|allow-cgi-request-crunching|buffer-limit|compression-level|confdir|connection-sharing|debug|default-server-timeout|deny-access|enable-compression|enable-edit-actions|enable-remote-http-toggle|enable-remote-toggle|enforce-blocks|filterfile|forward|forwarded-connect-retries|forward-socks4|forward-socks4a|forward-socks5|handle-as-empty-doc-returns-ok|hostname|keep-alive-timeout|listen-address|logdir|logfile|max-client-connections|permit-access|proxy-info-url|single-threaded|socket-timeout|split-large-forms|templdir|toggle|tolerate-pipelining|trustfile|trust-info-url|user-manual)[[:space:]]" ++HASHCOMMENT ++LINT + +syntax "privoxy-action" "\.action$" + +color brightred "[{[:space:]]\-block([[:space:]{}]|$)" +color brightgreen "[{[:space:]]\+block([[:space:]{}]|$)" + +color brightred "-(add-header|change-x-forwarded-for|client-header-filter|client-header-tagger|content-type-overwrite|crunch-client-header|crunch-if-none-match|crunch-incoming-cookies|crunch-outgoing-cookies|crunch-server-header|deanimate-gifs|downgrade-http-version|fast-redirects|filter|force-text-mode|forward-override|handle-as-empty-document|handle-as-image|hide-accept-language|hide-content-disposition|hide-from-header|hide-if-modified-since|hide-referrer|hide-user-agent|limit-connect|overwrite-last-modified|prevent-compression|redirect|server-header-filter|server-header-tagger|session-cookies-only|set-image-blocker)" +color brightgreen "\+(add-header|change-x-forwarded-for|client-header-filter|client-header-tagger|content-type-overwrite|crunch-client-header|crunch-if-none-match|crunch-incoming-cookies|crunch-outgoing-cookies|crunch-server-header|deanimate-gifs|downgrade-http-version|fast-redirects|filter|force-text-mode|forward-override|handle-as-empty-document|handle-as-image|hide-accept-language|hide-content-disposition|hide-from-header|hide-if-modified-since|hide-referrer|hide-user-agent|limit-connect|overwrite-last-modified|prevent-compression|redirect|server-header-filter|server-header-tagger|session-cookies-only|set-image-blocker)" +PLAIN: "[{}]" +ESCAPE: "\\.?" ++HASHCOMMENT ++LINT + +syntax "privoxy-filter" "\.filter$" + +KEYWORD: "^(FILTER|CLIENT-HEADER-FILTER|CLIENT-HEADER-TAGGER|SERVER-HEADER-FILTER|SERVER-HEADER-TAGGER): [a-z-]+" +FUNCTION: "^(FILTER|CLIENT-HEADER-FILTER|CLIENT-HEADER-TAGGER|SERVER-HEADER-FILTER|SERVER-HEADER-TAGGER):" +ESCAPE: "\\.?" ++HASHCOMMENT ++LINT + diff --git a/properties.nanorc b/properties.nanorc new file mode 100644 index 0000000..4e9f620 --- /dev/null +++ b/properties.nanorc @@ -0,0 +1,8 @@ +syntax "properties" "\.properties$" + +KEYWORD: "^[[:space:]]*[^#!]([^:= ]|\\[:= ])*[:= ]" +OPERATOR: "[:=]" +ESCAPE: "\\([#!=: ]|$)" +ESCAPE: "\\u[[:xdigit:]]{4}" +COMMENT: "^[[:space:]]*[#!].*$" ++LINT diff --git a/python.nanorc b/python.nanorc new file mode 100644 index 0000000..55d9a20 --- /dev/null +++ b/python.nanorc @@ -0,0 +1,20 @@ +syntax "python" "\.py$" "jhbuildrc$" +header "^#!.*/(env +)?python[-0-9._]*( |$)" + +KEYWORD: "\<(as|assert|break|class|continue|def|del|elif|else|except)\>" +KEYWORD: "\<(exec|finally|for|from|global|if|import|lambda)\>" +KEYWORD: "\<(pass|print|raise|return|try|while|with|yield|None)\>" ++FUNCTION +OPERATOR: "[-+*/|=%<>&~^]|\<(and|not|or|is|in)\>" +MACRO: "@[A-Za-z0-9_]+" +SECTION: "__[A-Za-z0-9_]+__" +BOOLEAN: "\<(True|False)\>" ++STRING +STRING: "['][^']*[^\\][']" "[']{3}.*[^\\][']{3}" +STRING: "["][^"]*[^\\]["]" "["]{3}.*[^\\]["]{3}" +STRING: start=""""[^"]" end=""""" +STRING: start="'''[^']" end="'''" +ESCAPE: "\\.?" ++HASHCOMMENT ++TODO ++LINT diff --git a/rpmspec.nanorc b/rpmspec.nanorc new file mode 100644 index 0000000..9ed3990 --- /dev/null +++ b/rpmspec.nanorc @@ -0,0 +1,26 @@ +syntax "rpmspec" "\.spec$" "\.rpmspec$" + +KEYWORD: "\<(Icon|ExclusiveOs|ExcludeOs):" +KEYWORD: "\<(BuildArch|BuildArchitectures|ExclusiveArch|ExcludeArch):" +KEYWORD: "\<(Conflicts|Obsoletes|Provides|Requires|Requires\(.*\)|Enhances|Suggests|BuildConflicts|BuildRequires|Recommends|PreReq|Supplements):" +KEYWORD: "\<(Epoch|Serial|Nosource|Nopatch):" +KEYWORD: "\<(AutoReq|AutoProv|AutoReqProv):" +KEYWORD: "\<(Copyright|License|Summary|Summary\(.*\)|Distribution|Vendor|Packager|Group|Source[0-9]*|Patch[0-9]*|BuildRoot|Prefix):" +KEYWORD: "\<(Name|Version|Release|Url|URL):" +KEYWORD: start="^(Source|Patch)" end=":" +KEYWORD: "(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)" +KEYWORD: "(ifarch|ifnarch|ifos|ifnos)" ++STRING +MACRO: "%(if|else|endif|define|global|undefine)" +MACRO: "%_?([A-Z_a-z_0-9_]*)" +MACRO: start="%\{" end="\}" +MACRO: start="%\{__" end="\}" +VARIABLE: "\$(RPM_BUILD_ROOT)\>" +SECTION: "^%(build$|changelog|check$|clean$|description)" +SECTION: "^%(files|install$|package|prep$)" +SECTION: "^%(pre|preun|pretrans|post|postun|posttrans)" +SECTION: "^%(trigger|triggerin|triggerpostun|triggerun|verifyscript)" ++HASHCOMMENT +NUMBER: "^\*.*$" ++LINT ++TODO diff --git a/ruby.nanorc b/ruby.nanorc new file mode 100644 index 0000000..ad0fc16 --- /dev/null +++ b/ruby.nanorc @@ -0,0 +1,10 @@ +syntax "ruby" "\.rb$|Rakefile$" + +KEYWORD: "\<(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)\>" +STRING: "(^|[[:space:]]):[A-Za-z0-9_]+\>" +REGEXP: "/([^/]|(\\/))*/[iomx]*" "%r\{([^}]|(\\}))*\}[iomx]*" ++STRING ++HASHCOMMENT +COMMENT: start="^=begin$" end="^=end$" ++TODO ++LINT diff --git a/sed.nanorc b/sed.nanorc new file mode 100644 index 0000000..21f10b5 --- /dev/null +++ b/sed.nanorc @@ -0,0 +1,8 @@ +syntax "sed" "\.sed$" +header "^#!.*bin/(env +)?sed( |$)" + +OPERATOR: "[|^$.*+]" +VARIABLE: "\{[0-9]+,?[0-9]*\}" +ESCAPE: "\\." ++HASHCOMMENT ++LINT diff --git a/shell.nanorc b/shell.nanorc new file mode 100644 index 0000000..df457fd --- /dev/null +++ b/shell.nanorc @@ -0,0 +1,16 @@ +syntax "sh" "\.sh$" "\.bash$" "bashrc$" "bash_profile$" +header "^#!.*/(env +)?(ba|k|pdk)?sh[-0-9_]*( |$)" + +FUNCTION: "^[A-Za-z0-9_+-]+[[:space:]]*\(\)" +KEYWORD: "\<(case|do|done|elif|else|esac|fi|for|function|if)\>" +KEYWORD: "\<(in|select|then|time|until|while)\>" +FUNCTION: "\<(echo|exit|export|let|local|read|return|set|shift|umask|unset)\>" +FUNCTION: "\<(source)\>" +OPERATOR: "[{}()<>!=&|;`$]|\\|\[|\]|-(eq|ne|gt|lt|ge|le|s|n|z)\>" +STRING: ""(\\.|[^"])*"" +VARIABLE: "\$\{?[A-Za-z0-9_!@#$*?-]+\}?|`[^`]*`" +STRING: "'(\\.|[^'])*'" +ESCAPE: "\\.?" ++HASHCOMMENT ++TODO ++LINT diff --git a/sql.nanorc b/sql.nanorc new file mode 100644 index 0000000..bc2a4b3 --- /dev/null +++ b/sql.nanorc @@ -0,0 +1,33 @@ +syntax "sql" "\.sql$" "sqliterc$" + +~KEYWORD: "\<(ALL|ASC|AS|ALTER|AND|ADD|AUTO_INCREMENT)\>" +~KEYWORD: "\<(BETWEEN|BINARY|BOTH|BY|BOOLEAN)\>" +~KEYWORD: "\<(CHANGE|CHECK|COLUMNS|COLUMN|CROSS|CREATE)\>" +~KEYWORD: "\<(DATABASES|DATABASE|DATA|DELAYED|DESCRIBE|DESC|DISTINCT|DELETE|DROP|DEFAULT)\>" +~KEYWORD: "\<(ENCLOSED|ESCAPED|EXISTS|EXPLAIN)\>" +~KEYWORD: "\<(FIELDS|FIELD|FLUSH|FOR|FOREIGN|FUNCTION|FROM)\>" +~KEYWORD: "\<(GROUP|GRANT|HAVING)\>" +~KEYWORD: "\<(IGNORE|INDEX|INFILE|INSERT|INNER|INTO|IDENTIFIED|IN|IS|IF)\>" +~KEYWORD: "\<(JOIN|KEYS|KILL|KEY)\>" +~KEYWORD: "\<(LEADING|LIKE|LIMIT|LINES|LOAD|LOCAL|LOCK|LOW_PRIORITY|LEFT|LANGUAGE)\>" +~KEYWORD: "\<(MODIFY|NATURAL|NOT|NULL|NEXTVAL)\>" +~KEYWORD: "\<(OPTIMIZE|OPTION|OPTIONALLY|ORDER|OUTFILE|OR|OUTER|ON)\>" +~KEYWORD: "\<(PROCEDURE|PROCEDURAL|PRIMARY)\>" +~KEYWORD: "\<(READ|REFERENCES|REGEXP|RENAME|REPLACE|RETURN|REVOKE|RLIKE|RIGHT)\>" +~KEYWORD: "\<(SHOW|SONAME|STATUS|STRAIGHT_JOIN|SELECT|SETVAL|SET)\>" +~KEYWORD: "\<(TABLES|TERMINATED|TO|TRAILING|TRUNCATE|TABLE|TEMPORARY|TRIGGER|TRUSTED)\>" +~KEYWORD: "\<(UNIQUE|UNLOCK|USE|USING|UPDATE|VALUES|VARIABLES|VIEW)\>" +~KEYWORD: "\<(WITH|WRITE|WHERE|ZEROFILL|TYPE|XOR)\>" +TYPE: "\<(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 +~KEYWORD: "\.\<(databases|dump|echo|exit|explain|header(s)?|help)\>" +~KEYWORD: "\.\<(import|indices|mode|nullvalue|output|prompt|quit|read)\>" +~KEYWORD: "\.\<(schema|separator|show|tables|timeout|width)\>" +BOOLEAN: "\<(ON|OFF)\>" + +NUMBER: "\<([0-9]+)\>" ++STRING +STRING: "`(\\.|[^\\`])*`" +COMMENT: "\-\-.*$" ++LINT diff --git a/systemd.nanorc b/systemd.nanorc new file mode 100644 index 0000000..8d49267 --- /dev/null +++ b/systemd.nanorc @@ -0,0 +1,11 @@ +syntax "systemd" "\.(service|socket|mount|slice|target|timer|path)$" +header "^\[Unit\]$" + +KEYWORD: "^(Accept|After|Alias|AllowIsolate|Also|ANSI_COLOR|_AUDIT_LOGINUID|_AUDIT_SESSION|Backlog|Before|BindIPv6Only|BindsTo|BindToDevice|BlockIOReadBandwidth|BlockIOWeight|BlockIOWriteBandwidth|_BOOT_ID|Broadcast|BUG_REPORT_URL|BusName|Capabilities|CapabilityBoundingSet|CHASSIS|cipher|class|_CMDLINE|CODE_FILE|CODE_FUNC|CODE_LINE|_COMM|Compress|ConditionACPower|ConditionCapability|ConditionDirectoryNotEmpty|ConditionFileIsExecutable|ConditionFileNotEmpty|ConditionHost|ConditionKernelCommandLine|ConditionNull|ConditionPathExists|ConditionPathExistsGlob|ConditionPathIsDirectory|ConditionPathIsMountPoint|ConditionPathIsReadWrite|ConditionPathIsSymbolicLink|ConditionSecurity|ConditionVirtualization|Conflicts|ControlGroup|ControlGroupAttribute|ControlGroupModify|ControlGroupPersistent|controllers|Controllers|CPE_NAME|CPUAffinity|CPUSchedulingPolicy|CPUSchedulingPriority|CPUSchedulingResetOnFork|CPUShares|CrashChVT|CrashShell|__CURSOR|debug|DefaultControllers|DefaultDependencies|DefaultLimitAS|DefaultLimitCORE|DefaultLimitCPU|DefaultLimitDATA|DefaultLimitFSIZE|DefaultLimitLOCKS|DefaultLimitMEMLOCK|DefaultLimitMSGQUEUE|DefaultLimitNICE|DefaultLimitNOFILE|DefaultLimitNPROC|DefaultLimitRSS|DefaultLimitRTPRIO|DefaultLimitRTTIME|DefaultLimitSIGPENDING|DefaultLimitSTACK|DefaultStandardError|DefaultStandardOutput|Description|DeviceAllow|DeviceDeny|DirectoryMode|DirectoryNotEmpty|Documentation|DumpCore|entropy|Environment|EnvironmentFile|ERRNO|event_timeout|_EXE|ExecReload|ExecStart|ExecStartPost|ExecStartPre|ExecStop|ExecStopPost|ExecStopPre|filter|FONT|FONT_MAP|FONT_UNIMAP|ForwardToConsole|ForwardToKMsg|ForwardToSyslog|FreeBind|freq|FsckPassNo|fstab|_GID|Group|GuessMainPID|HandleHibernateKey|HandleLidSwitch|HandlePowerKey|HandleSuspendKey|hash|HibernateKeyIgnoreInhibited|HOME_URL|_HOSTNAME|ICON_NAME|ID|IdleAction|IdleActionSec|ID_LIKE|ID_MODEL|ID_MODEL_FROM_DATABASE|IgnoreOnIsolate|IgnoreOnSnapshot|IgnoreSIGPIPE|InaccessibleDirectories|InhibitDelayMaxSec|init|IOSchedulingClass|IOSchedulingPriority|IPTOS|IPTTL|JobTimeoutSec|JoinControllers|KeepAlive|KEYMAP|KEYMAP_TOGGLE|KillExcludeUsers|KillMode|KillOnlyUsers|KillSignal|KillUserProcesses|LidSwitchIgnoreInhibited|LimitAS|LimitCORE|LimitCPU|LimitDATA|LimitFSIZE|LimitLOCKS|LimitMEMLOCK|LimitMSGQUEUE|LimitNICE|LimitNOFILE|LimitNPROC|LimitRSS|LimitRTPRIO|LimitRTTIME|LimitSIGPENDING|LimitSTACK|link_priority|valueListenDatagram|ListenFIFO|ListenMessageQueue|ListenNetlink|ListenSequentialPacket|ListenSpecial|ListenStream|LogColor|LogLevel|LogLocation|LogTarget|luks|_MACHINE_ID|MakeDirectory|Mark|MaxConnections|MaxFileSec|MaxLevelConsole|MaxLevelKMsg|MaxLevelStore|MaxLevelSyslog|MaxRetentionSec|MemoryLimit|MemorySoftLimit|MESSAGE|MESSAGE_ID|MessageQueueMaxMessages|MessageQueueMessageSize|__MONOTONIC_TIMESTAMP|MountFlags|NAME|NAutoVTs|Nice|NonBlocking|NoNewPrivileges|NotifyAccess|OnActiveSec|OnBootSec|OnCalendar|OnFailure|OnFailureIsolate|OnStartupSec|OnUnitActiveSec|OnUnitInactiveSec|OOMScoreAdjust|Options|output|PAMName|PartOf|PassCredentials|PassSecurity|PathChanged|PathExists|PathExistsGlob|PathModified|PermissionsStartOnly|_PID|PIDFile|PipeSize|PowerKeyIgnoreInhibited|PRETTY_HOSTNAME|PRETTY_NAME|Priority|PRIORITY|PrivateNetwork|PrivateTmp|PropagatesReloadTo|pss|RateLimitBurst|RateLimitInterval|ReadOnlyDirectories|ReadWriteDirectories|__REALTIME_TIMESTAMP|ReceiveBuffer|RefuseManualStart|RefuseManualStop|rel|ReloadPropagatedFrom|RemainAfterExit|RequiredBy|Requires|RequiresMountsFor|RequiresOverridable|Requisite|RequisiteOverridable|ReserveVT|ResetControllers|Restart|RestartPreventExitStatus|RestartSec|RootDirectory|RootDirectoryStartOnly|RuntimeKeepFree|RuntimeMaxFileSize|RuntimeMaxUse|RuntimeWatchdogSec|samples|scale_x|scale_y|Seal|SecureBits|_SELINUX_CONTEXT|SendBuffer|SendSIGKILL|Service|ShowStatus|ShutdownWatchdogSec|size|SmackLabel|SmackLabelIPIn|SmackLabelIPOut|SocketMode|Sockets|SourcePath|_SOURCE_REALTIME_TIMESTAMP|SplitMode|StandardError|StandardInput|StandardOutput|StartLimitAction|StartLimitBurst|StartLimitInterval|static_node|StopWhenUnneeded|Storage|string_escape|none|replaceSuccessExitStatus|SupplementaryGroups|SUPPORT_URL|SuspendKeyIgnoreInhibited|SyslogFacility|SYSLOG_FACILITY|SyslogIdentifier|SYSLOG_IDENTIFIER|SyslogLevel|SyslogLevelPrefix|SYSLOG_PID|SystemCallFilter|SYSTEMD_ALIAS|_SYSTEMD_CGROUP|_SYSTEMD_OWNER_UID|SYSTEMD_READY|_SYSTEMD_SESSION|_SYSTEMD_UNIT|_SYSTEMD_USER_UNIT|SYSTEMD_WANTS|SystemKeepFree|SystemMaxFileSize|SystemMaxUse|SysVStartPriority|TCPCongestion|TCPWrapName|timeout|TimeoutSec|TimeoutStartSec|TimeoutStopSec|TimerSlackNSec|Transparent|_TRANSPORT|tries|TTYPath|TTYReset|TTYVHangup|TTYVTDisallocate|Type|_UID|UMask|Unit|User|UtmpIdentifier|VERSION|VERSION_ID|WantedBy|Wants|WatchdogSec|What|Where|WorkingDirectory)=" +FUNCTION: "^\.include\>" +OPERATOR: "=" +SECTION: "^\[(Unit|Install|Service|Socket|Mount|Timer|Path)\]" +VARIABLE: "\$MAINPID" ++BOOLEAN ++HASHCOMMENT ++LINT diff --git a/tex.nanorc b/tex.nanorc new file mode 100644 index 0000000..c62eaa5 --- /dev/null +++ b/tex.nanorc @@ -0,0 +1,6 @@ +syntax "tex" "\.(tex|cls|ltx|sty|dtx|ins|bbl)$" + +MACRO: "\\[A-Za-z]+" +SECTION: "\\section" +COMMENT: "%.*" ++LINT diff --git a/theme.sed b/theme.sed new file mode 100644 index 0000000..b0d1837 --- /dev/null +++ b/theme.sed @@ -0,0 +1,19 @@ +s|^PLAIN:|color black| +s|^FUNCTION:|color brightblue| +s|^STRING:|color yellow| +s|^COMMENT:|color cyan| +s|^TYPE:|color green| +s|^BOOLEAN:|color brightcyan| +s|^NUMBER:|color blue| +s|^REGEXP:|color magenta| +s|^VARIABLE:|color brightyellow| +s|^OPERATOR:|color red| +s|^KEYWORD:|color brightblack| +s|^~KEYWORD:|icolor brightblack| +s|^MACRO:|color brightyellow| +s|^ESCAPE:|color magenta| +s|^JUMP:|color brightred| +s|^WARNING:|color brightwhite,red| +s|^SECTION:|color brightmagenta| +s|^TAG:|color brightmagenta| +s|^ATTRIBUTE:|color magenta| diff --git a/vala.nanorc b/vala.nanorc new file mode 100644 index 0000000..e483adc --- /dev/null +++ b/vala.nanorc @@ -0,0 +1,16 @@ +syntax "vala" "\.vala$" + +TYPE: "\<(float|double|bool|char|int|uint|short|long|void|(un)?signed)\>" ++FUNCTION +KEYWORD: "\<(for|if|while|do|else|case|default|switch|try|throw|catch)\>" +KEYWORD: "\<(inline|typedef|struct|enum|union|extern|static|const)\>" +KEYWORD: "\<(operator|new|delete|return|null|using)\>" +KEYWORD: "\<(class|override|private|public|signal|this|weak)\>" +JUMP: "\<(goto|break|continue)\>" ++BOOLEAN +NUMBER: "\<([0-9]+)\>" +OPERATOR: "[-+/*=<>?:!~%&|]" "->" ++STRING ++CCOMMENT ++TODO ++LINT diff --git a/vi.nanorc b/vi.nanorc new file mode 100644 index 0000000..4d4bd91 --- /dev/null +++ b/vi.nanorc @@ -0,0 +1,9 @@ +syntax "vi" "(^|/|\.)(ex|vim)rc$|\.vim" + ++FUNCTION +KEYWORD: "\<([nvxsoilc]?(nore|un)?map|[nvlx]n|[ico]?no|[cilovx][um]|s?unm)\>" +KEYWORD: "\<(snor|nun|nm|set|if|endif|let|unlet)\>" +OPERATOR: "[!&=]" ++STRING +COMMENT: "(^|[[:space:]])\"[^"]*$" ++LINT diff --git a/xml.nanorc b/xml.nanorc new file mode 100644 index 0000000..0620ae1 --- /dev/null +++ b/xml.nanorc @@ -0,0 +1,11 @@ +syntax "xml" "\.([jrs]html?|sgml?|xml|opml|xslt?|plist)$" +header "<\?xml" + +SECTION: start="<" end=">" +KEYWORD: " [a-z_-]+=" ++STRING +WARNING: "&" +ESCAPE: "&(#[0-9]+|#x[0-9a-fA-F]+|[A-Za-z][A-Za-z0-9]*);" +COMMENT: start="" +COMMENT: start="" ++LINT diff --git a/xresources.nanorc b/xresources.nanorc new file mode 100644 index 0000000..f202401 --- /dev/null +++ b/xresources.nanorc @@ -0,0 +1,9 @@ +syntax "xresources" "X(defaults|resources)$" + +TYPE: "^[[:alnum:]]+\*" +VARIABLE: "\*[[:alnum:]]+\:" +NUMBER: "\<[0-9]+\>" +OPERATOR: "[*:=]" ++BOOLEAN ++HASHCOMMENT ++LINT diff --git a/yaml.nanorc b/yaml.nanorc new file mode 100644 index 0000000..b4f3784 --- /dev/null +++ b/yaml.nanorc @@ -0,0 +1,12 @@ +syntax "yaml" "\.ya?ml$" +header "^---" "%YAML" + +TYPE: "(^| )!!(binary|bool|float|int|map|null|omap|seq|set|str) " +BOOLEAN: "\<(YES|yes|Y|y|ON|on|NO|no|N|n|OFF|off)\>" ++BOOLEAN +OPERATOR: ":[[:space:]]" "\[" "\]" ":[[:space:]]+[|>]" "^[[:space:]]*- " +VARIABLE: "[[:space:]][\*&][A-Za-z0-9]+" ++STRING ++HASHCOMMENT +SECTION: "^---" "^\.\.\." "^%YAML" "^%TAG" ++LINT diff --git a/yum.nanorc b/yum.nanorc new file mode 100644 index 0000000..1a08a4d --- /dev/null +++ b/yum.nanorc @@ -0,0 +1,6 @@ +syntax "yum" "\.repo$|yum.*\.conf$" + ++INI +VARIABLE: "\$(releasever|arch|basearch|uuid|YUM[0-9])" ++HASHCOMMENT ++LINT