summaryrefslogtreecommitdiff
path: root/doc/syntax/sh.nanorc
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2015-03-23 03:49:03 +0000
committer <>2015-03-25 17:06:51 +0000
commitfb040ea36cb8e2158ccd9100600652f94ae90af1 (patch)
treedba72a74e84a997c23fa0af7c07a4d831be2deb7 /doc/syntax/sh.nanorc
parent8b74abeb02c01ddc768c465a826360cf33cec063 (diff)
downloadnano-tarball-master.tar.gz
Imported from /home/lorry/working-area/delta_nano-tarball/nano-2.4.0.tar.gz.HEADnano-2.4.0master
Diffstat (limited to 'doc/syntax/sh.nanorc')
-rw-r--r--doc/syntax/sh.nanorc25
1 files changed, 19 insertions, 6 deletions
diff --git a/doc/syntax/sh.nanorc b/doc/syntax/sh.nanorc
index ecce22e..074e03a 100644
--- a/doc/syntax/sh.nanorc
+++ b/doc/syntax/sh.nanorc
@@ -1,14 +1,27 @@
## Here is an example for Bourne shell scripts.
-##
+
syntax "sh" "\.sh$"
-header "^#!.*/(ba|k|pdk)?sh[-0-9_]*"
+header "^#!.*((ba|da|k|pdk)?sh[-0-9_]*|openrc-run|runscript)"
+magic "(POSIX|Bourne.*) shell script text"
+
icolor brightgreen "^[0-9A-Z_]+\(\)"
-color green "\<(case|do|done|elif|else|esac|exit|fi|for|function|if|in|local|read|return|select|shift|then|time|until|while)\>"
-color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
+color green "\<(break|case|continue|do|done|elif|else|esac|exit|fi|for|function|if|in|read|return|select|shift|then|time|until|while)\>"
+color green "\<(declare|eval|exec|export|let|local)\>"
+color green "[{}():;|`$<>!=&\\]" "(\]|\[)"
color green "-[Ldefgruwx]\>"
color green "-(eq|ne|gt|lt|ge|le|s|n|z)\>"
-color brightblue "\<(cat|cd|chmod|chown|cp|echo|env|export|grep|install|let|ln|make|mkdir|mv|rm|sed|set|tar|touch|umask|unset)\>"
-icolor brightred "\$\{?[0-9A-Z_!@#$*?-]+\}?"
+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)\>"
+
+# Basic variable names (no braces).
+color brightred "\$[-0-9@*#?$!]" "\$[[:alpha:]_][[:alnum:]_]*"
+# More complicated variable names; handles braces and replacements and arrays.
+color brightred "\$\{[#!]?([-@*#?$!]|[0-9]+|[[:alpha:]_][[:alnum:]_]*)(\[([[:space:]]*[[:alnum:]_]+[[:space:]]*|@)\])?(([#%/]|:?[-=?+])[^}]*\}|\[|\})"
+
+# Comments.
color cyan "(^|[[:space:]])#.*$"
+
+# Strings.
color brightyellow ""(\\.|[^"])*"" "'(\\.|[^'])*'"
+
+# Trailing whitespace.
color ,green "[[:space:]]+$"