mirror of
https://github.com/scopatz/nanorc
synced 2024-11-24 11:20:26 +01:00
37 lines
1.2 KiB
Plaintext
37 lines
1.2 KiB
Plaintext
## Syntax highlighting for ZSH scripts (initially copied from sh.nanorc)
|
|
syntax "zsh" "\.?zsh[^\.]+?$"
|
|
header "^#!.*/(env +)?zsh( |$)"
|
|
|
|
## Numbers
|
|
color brightwhite "[0-9]+"
|
|
|
|
## Conditionals and control flow
|
|
color green "\<(always|case|do|done|elif|else|esac|exit|fi|for|function|if|in|local|read|return|select|shift|then|time|until|while)\>"
|
|
color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
|
|
## Conditional flags
|
|
color green "-[Ldefgruwx]\>"
|
|
color green "-(eq|ne|gt|lt|ge|le|s|n|z)\>"
|
|
|
|
## 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
|
|
color brightmagenta "\<(cat|chmod|chown|cp|echo|env|false|find|grep|install|kill|ln|make|mkdir|mv|pwd|rm|rmdir|sed|tar|true|touch|uname|wc|whoami)\>"
|
|
|
|
## Function definition
|
|
icolor brightgreen "^\s+?(function\s+)?[0-9A-Z_]+\s+?\(\)"
|
|
|
|
## Variables
|
|
icolor brightred "\$\{?[0-9A-Z_!@#$*?-]+\}?"
|
|
|
|
## Strings
|
|
color brightyellow ""(\\.|[^"])*""
|
|
color brightyellow "'(\\.|[^'])*'"
|
|
|
|
## Comments
|
|
color cyan "(^|[[:space:]])#.*$"
|
|
|
|
## Trailing spaces
|
|
color ,blue "[[:space:]]+$"
|