dotfiles-pub/common/nano/syntax/sh.nanorc

57 lines
2.5 KiB
Text

syntax "sh" "\.sh$" "\.bash$" "bashrc$" "bash_profile$" "\.bashrc_all$"
header "^#!.*/(env +)?(ba|k|pdk)?sh[-0-9_]*( |$)"
# Resets everything back to plain text coloring.
# Can be used at the start of each theme file.
color white "^.*$"
color cyan "^[A-Za-z0-9_+-]+[[:space:]]*\(\)"
color cyan "^function [0-9A-Za-z_+-]+[[:space:]]*\(\)"
color red "\<(case|do|done|elif|else|esac|fi|for|function|if)\>"
color red "\<(in|select|then|time|until|while)\>"
color cyan "\<(echo|exit|export|let|local|read|return|set|shift|source|umask|unset)\>"
color cyan "\<(alias|bg|bind|break|builtin|cd|command|compgen|complete|continue|dirs|disown|enable|eval|exec|fc|fg|getopts|hash|help|history|jobs|kill|logout|popd|printf|pushd|pwd|shopt|suspend|test|times|trap|type|ulimit|unalias|wait)\>"
# Unkeywordify commandline arguments
color white "(^|[[:space:]])--?(alias|bg|bind|break|builtin|case|cd|command|compgen|complete|continue)\>"
color white "(^|[[:space:]])--?(dirs|disown|do|done|echo|elif|else|enable|esac|eval|exec|exit|export)\>"
color white "(^|[[:space:]])--?(fc|fg|fi|for|function|getopts|hash|help|history|if|in|jobs|kill|let|local|logout)\>"
color white "(^|[[:space:]])--?(popd|printf|pushd|pwd|read|return|select|set|shift|shopt|source|suspend)\>"
color white "(^|[[:space:]])--?(test|then|time|times|trap|type|ulimit|umask|unalias|unset|until|wait|while)\>"
# Unkeywordify occurrences in paths
color white "/local\>"
color white "(^|[[:space:]])local/"
# Make white spaces plain again
color white "[[:space:]]+"
color yellow "[{}()<>!=&|;`$]|\\|\[|\]|-(eq|ne|gt|lt|ge|le|s|n|z)\>"
color green ""(\\"|[^"])*""
color blue "\$[A-Za-z0-9_!@#$*?-]+"
color blue "\$\{(\\.|[^}])+\}"
color blue "`[^`]*`"
color yellow "\\.?"
color green "'[^']*'"
color brightblack "(^|[[:space:]])#([^{].*)?$"
color brightwhite,cyan "\<TODO\>:?"
color brightwhite,cyan "\<FIXME\>:?"
color ,red "[[:space:]]+$"
color brightyellow " + +| + +"
# rainbow indent
color ,brightblack "^[[:space:]]{32}"
color ,black "^[[:space:]]{30}"
color ,brightblack "^[[:space:]]{28}"
color ,black "^[[:space:]]{26}"
color ,brightblack "^[[:space:]]{24}"
color ,black "^[[:space:]]{22}"
color ,brightblack "^[[:space:]]{20}"
color ,black "^[[:space:]]{18}"
color ,brightblack "^[[:space:]]{16}"
color ,black "^[[:space:]]{14}"
color ,brightblack "^[[:space:]]{12}"
color ,black "^[[:space:]]{10}"
color ,brightblack "^[[:space:]]{8}"
color ,black "^[[:space:]]{6}"
color ,brightblack "^[[:space:]]{4}"
color ,black "^[[:space:]]{2}"