mirror of
git://git.sv.gnu.org/nano.git
synced 2024-12-14 23:02:37 +03:00
3de2c704ef
Patch by Mark Oteiza. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5203 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
29 lines
1.1 KiB
Plaintext
29 lines
1.1 KiB
Plaintext
## Here is an example for Bourne shell scripts.
|
|
|
|
syntax "sh" "\.sh$"
|
|
header "^#!.*((ba|da|k|pdk)?sh[-0-9_]*|openrc-run|runscript)"
|
|
magic "(POSIX|Bourne.*) shell script text"
|
|
linter dash -n
|
|
|
|
icolor brightgreen "^[0-9A-Z_]+\(\)"
|
|
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 "\<(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:]]+$"
|