view nanorc.d/sh.nanorc @ 92:5f2c5800fa8a

Fix small differences with older Nano on the server
author IBBoard <dev@ibboard.co.uk>
date Mon, 02 Apr 2018 17:30:20 +0100
parents a5810e6bed7e
children
line wrap: on
line source

## 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-Again) shell script.*text"
linter dash -n
comment "#"

icolor cyan "^[0-9A-Z_]+\(\)"
color cyan "\<(break|case|continue|do|done|elif|else|esac|exit|fi|for|function|if|in|read|return|select|shift|then|time|until|while)\>"
color cyan "\<(declare|eval|exec|export|let|local)[[:space:]]\>"
color cyan "[{}():;|`$<>!=&\\]" "(\]|\[)"
color cyan "(function )?[a-zA-Z0-9_]+[[:space:]]*\(\)"
color cyan "-[Ldefgruwx]\>"
color red "-(eq|ne|gt|lt|ge|le|s|n|z)\>"
color red "&&|\|\|"
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 magenta "\$[-0-9@*#?$!]" "\$[[:alpha:]_][[:alnum:]_]*"
# More complicated variable names; handles braces and replacements and arrays.
color magenta "\$\{[#!]?([-@*#?$!]|[0-9]+|[[:alpha:]_][[:alnum:]_]*)(\[([[:space:]]*[[:alnum:]_]+[[:space:]]*|@)\])?(([#%/]|:?[-=?+])[^}]*\}|\[|\})"

# Strings.
color yellow ""(\\.|[^"])*"" "'(\\.|[^'])*'"

# Comments.
color green "(^|[[:space:]])#.*$"

# Trailing whitespace.
color ,green "[[:space:]]+$"