2014-07-16 13:01:38 +02:00
## Syntax highlighting for ZSH scripts (initially copied from sh.nanorc)
syntax "zsh" "\.?zsh[^\.]+?$"
2014-07-16 13:37:23 +02:00
header "^#!.*/(env +)?zsh( |$)"
2014-07-15 17:58:12 +02:00
2014-07-16 13:01:38 +02:00
## Numbers
2014-07-21 11:22:44 +02:00
color brightyellow "\b[0-9]+\b"
2014-07-16 13:01:38 +02:00
2014-07-15 17:58:12 +02:00
## Conditionals and control flow
2014-07-16 13:01:38 +02:00
color green "\<(always|case|do|done|elif|else|esac|exit|fi|for|function|if|in|local|read|return|select|shift|then|time|until|while)\>"
2014-07-15 17:58:12 +02:00
color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
## Conditional flags
color green "-[Ldefgruwx]\>"
color green "-(eq|ne|gt|lt|ge|le|s|n|z)\>"
2014-07-16 13:01:38 +02:00
## Bash-inherited
color brightblue "\<(alias|bindkey|builtin|cd|eval|exec|export|jobs|let|popd|pushd|set|source|typeset|umask|unset)\>"
## ZSH-specific
color brightblue "\<(add-zsh-hook|autoload|compinit|echotc|emulate|print|prompt(init)?|setopt|zle|zmodload|zstyle)\>"
## Common linux commands
2014-07-17 12:18:35 +02:00
color brightmagenta "\<(cat|chmod|chown|cp|cut|echo|env|false|find|grep|head|install|kill|less|ln|make|mkdir|mv|pwd|rm|rmdir|sed|tar|true|touch|uname|wc|whoami)\>"
2014-07-15 17:58:12 +02:00
2014-07-16 13:55:37 +02:00
## Function definition
icolor brightgreen "^\s+?(function\s+)?[0-9A-Z_]+\s+?\(\)"
2014-07-15 17:58:12 +02:00
## Variables
icolor brightred "\$\{?[0-9A-Z_!@#$*?-]+\}?"
## Strings
color brightyellow ""(\\.|[^"])*""
color brightyellow "'(\\.|[^'])*'"
2014-07-16 13:01:38 +02:00
## Comments
color cyan "(^|[[:space:]])#.*$"
2014-07-15 17:58:12 +02:00
## Trailing spaces
2014-07-16 13:01:38 +02:00
color ,blue "[[:space:]]+$"