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=">"