Mercurial > repos > other > linux
annotate nanorc.d/sh.nanorc @ 93:411e0a1c4382
Hide warnings and solve cross-version compatibility
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Mon, 02 Apr 2018 19:21:36 +0100 |
parents | 5f2c5800fa8a |
children |
rev | line source |
---|---|
89 | 1 ## Here is an example for Bourne shell scripts. |
2 | |
92
5f2c5800fa8a
Fix small differences with older Nano on the server
IBBoard <dev@ibboard.co.uk>
parents:
89
diff
changeset
|
3 syntax "sh" "\.sh$" |
89 | 4 header "^#!.*((ba|da|k|pdk)?sh[-0-9_]*|openrc-run|runscript)" |
5 magic "(POSIX|Bourne-Again) shell script.*text" | |
6 linter dash -n | |
7 comment "#" | |
8 | |
9 icolor cyan "^[0-9A-Z_]+\(\)" | |
10 color cyan "\<(break|case|continue|do|done|elif|else|esac|exit|fi|for|function|if|in|read|return|select|shift|then|time|until|while)\>" | |
11 color cyan "\<(declare|eval|exec|export|let|local)[[:space:]]\>" | |
12 color cyan "[{}():;|`$<>!=&\\]" "(\]|\[)" | |
13 color cyan "(function )?[a-zA-Z0-9_]+[[:space:]]*\(\)" | |
14 color cyan "-[Ldefgruwx]\>" | |
15 color red "-(eq|ne|gt|lt|ge|le|s|n|z)\>" | |
16 color red "&&|\|\|" | |
17 color brightblue "\<(awk|cat|cd|ch(grp|mod|own)|cp|echo|env|grep|install|ln|make|mkdir|mv|popd|printf|pushd|rm|rmdir|sed|set|tar|touch|umask|unset)\>" | |
18 | |
19 # Basic variable names (no braces). | |
20 color magenta "\$[-0-9@*#?$!]" "\$[[:alpha:]_][[:alnum:]_]*" | |
21 # More complicated variable names; handles braces and replacements and arrays. | |
22 color magenta "\$\{[#!]?([-@*#?$!]|[0-9]+|[[:alpha:]_][[:alnum:]_]*)(\[([[:space:]]*[[:alnum:]_]+[[:space:]]*|@)\])?(([#%/]|:?[-=?+])[^}]*\}|\[|\})" | |
23 | |
24 # Strings. | |
25 color yellow ""(\\.|[^"])*"" "'(\\.|[^'])*'" | |
26 | |
27 # Comments. | |
28 color green "(^|[[:space:]])#.*$" | |
29 | |
30 # Trailing whitespace. | |
31 color ,green "[[:space:]]+$" |