From 97f06f6c7381641ce89b5e1afb2732f4f73cc69c Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Wed, 18 Dec 2019 11:13:13 -0500 Subject: [PATCH 1/2] * Nanorc: Copy comment syntax from nano 4.6 nanorcs --- asm.nanorc | 2 ++ awk.nanorc | 1 + c.nanorc | 1 + cmake.nanorc | 1 + fortran.nanorc | 2 +- gentoo.nanorc | 2 ++ go.nanorc | 1 + groff.nanorc | 2 ++ java.nanorc | 2 ++ javascript.nanorc | 2 +- js.nanorc | 1 + json.nanorc | 2 ++ lua.nanorc | 1 + makefile.nanorc | 1 + man.nanorc | 2 ++ nanorc.nanorc | 2 ++ ocaml.nanorc | 4 ++++ patch.nanorc | 3 +++ perl.nanorc | 1 + php.nanorc | 1 + po.nanorc | 1 + pov.nanorc | 2 ++ python.nanorc | 1 + ruby.nanorc | 1 + rust.nanorc | 3 +++ sh.nanorc | 2 ++ tcl.nanorc | 2 ++ tex.nanorc | 2 ++ xml.nanorc | 1 + 29 files changed, 47 insertions(+), 2 deletions(-) diff --git a/asm.nanorc b/asm.nanorc index c5c5bd5..b08e250 100644 --- a/asm.nanorc +++ b/asm.nanorc @@ -1,6 +1,8 @@ ## Here is an example for assembler. ## syntax "ASM" "\.(S|s|asm)$" +comment "//" + color red "\<[A-Z_]{2,}\>" color brightgreen "\.(data|subsection|text)" color green "\.(align|file|globl|global|hidden|section|size|type|weak)" diff --git a/awk.nanorc b/awk.nanorc index ad343aa..f41b8bf 100644 --- a/awk.nanorc +++ b/awk.nanorc @@ -1,5 +1,6 @@ syntax "AWK" "\.awk$" header "^#!.*bin/(env +)?awk( |$)" +comment "#" color brightyellow "\$[A-Za-z0-9_!@#$*?-]+" color brightyellow "\<(ARGC|ARGIND|ARGV|BINMODE|CONVFMT|ENVIRON|ERRNO|FIELDWIDTHS)\>" diff --git a/c.nanorc b/c.nanorc index 7b16cf6..f2fe00d 100644 --- a/c.nanorc +++ b/c.nanorc @@ -1,6 +1,7 @@ ## Here is an example for C/C++. ## syntax "C" "\.(c(c|pp|xx)?|C)$" "\.(h(h|pp|xx)?|H)$" "\.ii?$" "\.(def)$" +comment "//" color brightred "\<[A-Z_][0-9A-Z_]+\>" color green "\<(float|double|bool|char|wchar_t|int|short|long|sizeof|enum|void|static|const|struct|union|typedef|extern|(un)?signed|inline)\>" color green "\<((s?size)|(char(16|32))|((u_?)?int(_fast|_least)?(8|16|32|64))|u?int(max|ptr))_t\>" diff --git a/cmake.nanorc b/cmake.nanorc index e5ae059..728d14a 100644 --- a/cmake.nanorc +++ b/cmake.nanorc @@ -1,6 +1,7 @@ ## CMake syntax highlighter for GNU Nano ## syntax "CMake" "(CMakeLists\.txt|\.cmake)$" +comment "#" icolor green "^[[:space:]]*[A-Z0-9_]+" icolor brightyellow "^[[:space:]]*(include|include_directories|include_external_msproject)\>" diff --git a/fortran.nanorc b/fortran.nanorc index 2b77e6b..73534d8 100644 --- a/fortran.nanorc +++ b/fortran.nanorc @@ -1,7 +1,7 @@ ## Here is an example for Fortran 90/95 syntax "Fortran" "\.([Ff]|[Ff]90|[Ff]95|[Ff][Oo][Rr])$" - +comment "!" #color red "\<[A-Z_]a[0-9A-Z_]+\>" color red "\<[0-9]+\>" diff --git a/gentoo.nanorc b/gentoo.nanorc index 24b5485..4959fa9 100644 --- a/gentoo.nanorc +++ b/gentoo.nanorc @@ -1,6 +1,8 @@ ## Here is an example for ebuilds/eclasses ## syntax "Ebuild" "\.e(build|class)$" +comment "#" + ## All the standard portage functions color brightgreen "^src_(unpack|compile|install|test)" "^pkg_(config|nofetch|setup|(pre|post)(inst|rm))" ## Highlight bash related syntax diff --git a/go.nanorc b/go.nanorc index b603c2f..d5d8ca8 100644 --- a/go.nanorc +++ b/go.nanorc @@ -1,4 +1,5 @@ syntax "GO" "\.go$" +comment "//" color brightblue "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[()]" color brightblue "\<(append|cap|close|complex|copy|delete|imag|len)\>" diff --git a/groff.nanorc b/groff.nanorc index 6a0ecc7..508c4ab 100644 --- a/groff.nanorc +++ b/groff.nanorc @@ -1,6 +1,8 @@ ## Here is an example for groff. ## syntax "Groff" "\.m[ems]$" "\.rof" "\.tmac$" "^tmac." +comment ".\"" + ## The argument of .ds or .nr color cyan "^\.(ds|nr) [^[[:space:]]]*" ## Single character escapes diff --git a/java.nanorc b/java.nanorc index 53b0b5e..f285462 100644 --- a/java.nanorc +++ b/java.nanorc @@ -1,6 +1,8 @@ ## Here is an example for Java. ## syntax "Java" "\.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|package|private|protected|public|static|strictfp|super|synchronized|throws|volatile)\>" diff --git a/javascript.nanorc b/javascript.nanorc index 85925d3..0f5c236 100644 --- a/javascript.nanorc +++ b/javascript.nanorc @@ -1,5 +1,5 @@ syntax "JavaScript" "\.js$" - +comment "//" color blue "\<[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\>" color blue "\<[-+]?([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?" color blue "\<[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?" diff --git a/js.nanorc b/js.nanorc index 0d9cb33..d5f1d8d 100644 --- a/js.nanorc +++ b/js.nanorc @@ -13,6 +13,7 @@ ## New updated taken from http://wiki.linuxhelp.net/index.php/Nano_Syntax_Highlighting syntax "JavaScript" "\.(js)$" +comment "//" ## Default color white "^.+$" diff --git a/json.nanorc b/json.nanorc index deca0e1..1f79c18 100644 --- a/json.nanorc +++ b/json.nanorc @@ -1,5 +1,7 @@ syntax "JSON" "\.json$" header "^\{$" +# You can't add a comment to JSON. +comment "" color blue "\<[-]?[1-9][0-9]*([Ee][+-]?[0-9]+)?\>" "\<[-]?[0](\.[0-9]+)?\>" color cyan "\" diff --git a/lua.nanorc b/lua.nanorc index 9138a8f..dd12ef5 100644 --- a/lua.nanorc +++ b/lua.nanorc @@ -13,6 +13,7 @@ # Automatically use for '.lua' files syntax "Lua" ".*\.lua$" +comment "--" # General color brightwhite ".+" diff --git a/makefile.nanorc b/makefile.nanorc index 12db1e2..c008148 100644 --- a/makefile.nanorc +++ b/makefile.nanorc @@ -1,5 +1,6 @@ syntax "Makefile" "([Mm]akefile|\.ma?k)$" header "^#!.*/(env +)?[bg]?make( |$)" +comment "#" color cyan "\<(ifeq|ifdef|ifneq|ifndef|else|endif)\>" color cyan "^(export|include|override)\>" diff --git a/man.nanorc b/man.nanorc index 59334be..e718d5c 100644 --- a/man.nanorc +++ b/man.nanorc @@ -1,6 +1,8 @@ ## Here is an example for manpages. ## syntax "Man" "\.[1-9]x?$" +comment ".\"" + color green "\.(S|T)H.*$" color brightgreen "\.(S|T)H" "\.TP" color brightred "\.(BR?|I[PR]?).*$" diff --git a/nanorc.nanorc b/nanorc.nanorc index a224372..3eeb9a9 100644 --- a/nanorc.nanorc +++ b/nanorc.nanorc @@ -1,6 +1,8 @@ ## Here is an example for nanorc files. ## syntax "Nanorc" "\.?nanorc$" +comment "#" + ## Possible errors and parameters icolor brightred "^[[:space:]]*((un)?set|include|syntax|i?color).*$" ## Colors diff --git a/ocaml.nanorc b/ocaml.nanorc index f5cd2c7..455fa6f 100644 --- a/ocaml.nanorc +++ b/ocaml.nanorc @@ -1,4 +1,8 @@ +## Syntax highlighting for OCaml. + syntax "OCaml" "\.mli?$" +comment "(*|*)" + #uid color red "\<[A-Z][0-9a-z_]{2,}\>" #declarations diff --git a/patch.nanorc b/patch.nanorc index 7e9b16a..73e6326 100644 --- a/patch.nanorc +++ b/patch.nanorc @@ -1,6 +1,9 @@ ## Here is an example for patch files. ## syntax "Patch" "\.(patch|diff)$" +# You can't add comments in patch files. +comment "" + color brightgreen "^\+.*" color green "^\+\+\+.*" color brightblue "^ .*" diff --git a/perl.nanorc b/perl.nanorc index 3e629b9..88e2a1e 100644 --- a/perl.nanorc +++ b/perl.nanorc @@ -2,6 +2,7 @@ ## syntax "Perl" "\.p[lm]$" header "^#!.*/(env +)?perl( |$)" +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)\>" diff --git a/php.nanorc b/php.nanorc index ec6832e..3c0e187 100644 --- a/php.nanorc +++ b/php.nanorc @@ -1,5 +1,6 @@ ## PHP Syntax Highlighting syntax "PHP" "\.php[2345s~]?$" +comment "//" color white start="<\?(php|=)?" end="\?>" # Functions color brightblue "([a-zA-Z0-9_-]*)\(" diff --git a/po.nanorc b/po.nanorc index d434b2a..24bc6a6 100644 --- a/po.nanorc +++ b/po.nanorc @@ -1,4 +1,5 @@ syntax "PO" "\.pot?$" +comment "#" color cyan "\<(msgid|msgstr)\>" color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'" diff --git a/pov.nanorc b/pov.nanorc index 6e71e27..5d18ee8 100644 --- a/pov.nanorc +++ b/pov.nanorc @@ -1,6 +1,8 @@ ## 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)\>" diff --git a/python.nanorc b/python.nanorc index 0517bd8..a127364 100644 --- a/python.nanorc +++ b/python.nanorc @@ -3,6 +3,7 @@ syntax "python" "\.py$" header "^#!.*/(env +)?python[-0-9._]*( |$)" magic "Python script" +comment "#" ## built-in objects color cyan "\<(None|self|True|False)\>" diff --git a/ruby.nanorc b/ruby.nanorc index ca4f3a6..d064984 100644 --- a/ruby.nanorc +++ b/ruby.nanorc @@ -2,6 +2,7 @@ ## syntax "Ruby" "\.rb$" "Gemfile" "config.ru" "Rakefile" "Capfile" "Vagrantfile" header "^#!.*/(env +)?ruby( |$)" +comment "#" ## Asciibetical list of reserved words color yellow "\<(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)\>" diff --git a/rust.nanorc b/rust.nanorc index f776b64..a7b139b 100644 --- a/rust.nanorc +++ b/rust.nanorc @@ -2,7 +2,10 @@ # Copyright 2015 The Rust Project Developers. # # NOTE: Rules are applied in order: later rules re-colorize matching text. + + syntax "Rust" "\.rs" +comment "//" # function definition color magenta "fn [a-z0-9_]+" diff --git a/sh.nanorc b/sh.nanorc index 4eeb07d..3b27e18 100644 --- a/sh.nanorc +++ b/sh.nanorc @@ -2,6 +2,8 @@ ## syntax "SH" "\.sh$" "\.bashrc" "bashrc" "\.bash_aliases" "bash_aliases" "\.bash_functions" "bash_functions" "\.bash_login" "\.bash_logout" "\.bash_profile" "bash_profile" "\.profile" "revise\..+$" header "^#!.*/(env +)?(ba)?sh( |$)" +comment "#" + ## keywords: color green "\<(case|do|done|elif|else|esac|fi|for|function|if|in|select|then|time|until|while)\>" color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)" diff --git a/tcl.nanorc b/tcl.nanorc index 7829cb0..e08ff6a 100644 --- a/tcl.nanorc +++ b/tcl.nanorc @@ -1,6 +1,8 @@ syntax "TCL" "\.tcl$" header "^#!.*/(env +)?tclsh( |$)" +comment "#" + ## Standard Tcl [info commands] color cyan "\<(after|append|array|auto_execok|auto_import|auto_load|auto_load_index|auto_qualify|binary|break|case|catch|cd|clock|close|concat|continue|else|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 sub commands diff --git a/tex.nanorc b/tex.nanorc index b768ed1..208f9af 100644 --- a/tex.nanorc +++ b/tex.nanorc @@ -1,6 +1,8 @@ ## Here is a short example for TeX files. ## syntax "TeX" "\.tex$" "bib" "\.bib$" "cls" "\.cls$" +comment "%" + color yellow "\$(\\\$|[^$])*[^\\]\$" color yellow "\$\$(\\\$|[^$])*[^\\]\$\$" icolor green "\\.|\\[A-Z]*" diff --git a/xml.nanorc b/xml.nanorc index 8ad5a32..1ebe934 100644 --- a/xml.nanorc +++ b/xml.nanorc @@ -2,6 +2,7 @@ ## syntax "XML" ".*\.([jrs]?html?|xml|sgml?|rng)$" +comment "" color white "^.+$" color green start="<" end=">" color cyan "<[^> ]+" From db98b9f1b5b8ac17021b77acde40d8854a95de3f Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Wed, 18 Dec 2019 11:20:31 -0500 Subject: [PATCH 2/2] * NanoRC Files: Copy linter and magic from nano 4.6 configs --- asm.nanorc | 1 + awk.nanorc | 1 + c.nanorc | 1 + java.nanorc | 1 + lua.nanorc | 3 +++ makefile.nanorc | 1 + man.nanorc | 1 + ocaml.nanorc | 1 + patch.nanorc | 1 + perl.nanorc | 1 + php.nanorc | 1 + python.nanorc | 2 ++ ruby.nanorc | 2 ++ sh.nanorc | 3 +++ tcl.nanorc | 1 + tex.nanorc | 3 +++ xml.nanorc | 2 ++ 17 files changed, 26 insertions(+) diff --git a/asm.nanorc b/asm.nanorc index b08e250..b27a272 100644 --- a/asm.nanorc +++ b/asm.nanorc @@ -1,6 +1,7 @@ ## Here is an example for assembler. ## syntax "ASM" "\.(S|s|asm)$" +magic "assembler source" comment "//" color red "\<[A-Z_]{2,}\>" diff --git a/awk.nanorc b/awk.nanorc index f41b8bf..501bc97 100644 --- a/awk.nanorc +++ b/awk.nanorc @@ -1,5 +1,6 @@ syntax "AWK" "\.awk$" header "^#!.*bin/(env +)?awk( |$)" +magic "awk script" comment "#" color brightyellow "\$[A-Za-z0-9_!@#$*?-]+" diff --git a/c.nanorc b/c.nanorc index f2fe00d..22ffea6 100644 --- a/c.nanorc +++ b/c.nanorc @@ -1,6 +1,7 @@ ## Here is an example for C/C++. ## syntax "C" "\.(c(c|pp|xx)?|C)$" "\.(h(h|pp|xx)?|H)$" "\.ii?$" "\.(def)$" +magic "^(C|C\+\+) (source|program)" comment "//" color brightred "\<[A-Z_][0-9A-Z_]+\>" color green "\<(float|double|bool|char|wchar_t|int|short|long|sizeof|enum|void|static|const|struct|union|typedef|extern|(un)?signed|inline)\>" diff --git a/java.nanorc b/java.nanorc index f285462..46e5dd5 100644 --- a/java.nanorc +++ b/java.nanorc @@ -1,6 +1,7 @@ ## 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)\>" diff --git a/lua.nanorc b/lua.nanorc index dd12ef5..bec44ad 100644 --- a/lua.nanorc +++ b/lua.nanorc @@ -13,8 +13,11 @@ # Automatically use for '.lua' files syntax "Lua" ".*\.lua$" +magic "Lua script" comment "--" +linter luacheck --no-color + # General color brightwhite ".+" diff --git a/makefile.nanorc b/makefile.nanorc index c008148..5bda434 100644 --- a/makefile.nanorc +++ b/makefile.nanorc @@ -1,5 +1,6 @@ syntax "Makefile" "([Mm]akefile|\.ma?k)$" header "^#!.*/(env +)?[bg]?make( |$)" +magic "makefile script" comment "#" color cyan "\<(ifeq|ifdef|ifneq|ifndef|else|endif)\>" diff --git a/man.nanorc b/man.nanorc index e718d5c..5239bea 100644 --- a/man.nanorc +++ b/man.nanorc @@ -1,6 +1,7 @@ ## Here is an example for manpages. ## syntax "Man" "\.[1-9]x?$" +magic "troff or preprocessor input" comment ".\"" color green "\.(S|T)H.*$" diff --git a/ocaml.nanorc b/ocaml.nanorc index 455fa6f..d1bba12 100644 --- a/ocaml.nanorc +++ b/ocaml.nanorc @@ -1,6 +1,7 @@ ## Syntax highlighting for OCaml. syntax "OCaml" "\.mli?$" +magic "OCaml" comment "(*|*)" #uid diff --git a/patch.nanorc b/patch.nanorc index 73e6326..bd282b7 100644 --- a/patch.nanorc +++ b/patch.nanorc @@ -1,6 +1,7 @@ ## Here is an example for patch files. ## syntax "Patch" "\.(patch|diff)$" +magic "diff output" # You can't add comments in patch files. comment "" diff --git a/perl.nanorc b/perl.nanorc index 88e2a1e..117a95c 100644 --- a/perl.nanorc +++ b/perl.nanorc @@ -2,6 +2,7 @@ ## syntax "Perl" "\.p[lm]$" header "^#!.*/(env +)?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)\>" diff --git a/php.nanorc b/php.nanorc index 3c0e187..e9e2959 100644 --- a/php.nanorc +++ b/php.nanorc @@ -1,5 +1,6 @@ ## PHP Syntax Highlighting syntax "PHP" "\.php[2345s~]?$" +magic "PHP script" comment "//" color white start="<\?(php|=)?" end="\?>" # Functions diff --git a/python.nanorc b/python.nanorc index a127364..70022a3 100644 --- a/python.nanorc +++ b/python.nanorc @@ -5,6 +5,8 @@ header "^#!.*/(env +)?python[-0-9._]*( |$)" magic "Python script" comment "#" +linter pyflakes + ## built-in objects color cyan "\<(None|self|True|False)\>" ## built-in attributes diff --git a/ruby.nanorc b/ruby.nanorc index d064984..7e8aef1 100644 --- a/ruby.nanorc +++ b/ruby.nanorc @@ -2,6 +2,8 @@ ## syntax "Ruby" "\.rb$" "Gemfile" "config.ru" "Rakefile" "Capfile" "Vagrantfile" header "^#!.*/(env +)?ruby( |$)" +magic "Ruby script" +linter ruby -w -c comment "#" ## Asciibetical list of reserved words diff --git a/sh.nanorc b/sh.nanorc index 3b27e18..3771b87 100644 --- a/sh.nanorc +++ b/sh.nanorc @@ -2,8 +2,11 @@ ## syntax "SH" "\.sh$" "\.bashrc" "bashrc" "\.bash_aliases" "bash_aliases" "\.bash_functions" "bash_functions" "\.bash_login" "\.bash_logout" "\.bash_profile" "bash_profile" "\.profile" "revise\..+$" header "^#!.*/(env +)?(ba)?sh( |$)" +magic "(POSIX|Bourne-Again) shell script.*text" comment "#" +linter dash -n + ## keywords: color green "\<(case|do|done|elif|else|esac|fi|for|function|if|in|select|then|time|until|while)\>" color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)" diff --git a/tcl.nanorc b/tcl.nanorc index e08ff6a..99c9ae0 100644 --- a/tcl.nanorc +++ b/tcl.nanorc @@ -1,6 +1,7 @@ syntax "TCL" "\.tcl$" header "^#!.*/(env +)?tclsh( |$)" +magic "Tcl(/Tk)? script" comment "#" ## Standard Tcl [info commands] diff --git a/tex.nanorc b/tex.nanorc index 208f9af..8b281d5 100644 --- a/tex.nanorc +++ b/tex.nanorc @@ -1,8 +1,11 @@ ## Here is a short example for TeX files. ## syntax "TeX" "\.tex$" "bib" "\.bib$" "cls" "\.cls$" +magic "(La)?TeX document" comment "%" +linter chktex -v0 -q -I + color yellow "\$(\\\$|[^$])*[^\\]\$" color yellow "\$\$(\\\$|[^$])*[^\\]\$\$" icolor green "\\.|\\[A-Z]*" diff --git a/xml.nanorc b/xml.nanorc index 1ebe934..bd7b273 100644 --- a/xml.nanorc +++ b/xml.nanorc @@ -2,6 +2,8 @@ ## syntax "XML" ".*\.([jrs]?html?|xml|sgml?|rng)$" +header "<\?xml.*version=.*\?>" +magic "(XML|SGML) (sub)?document" comment "" color white "^.+$" color green start="<" end=">"