mirror of
https://github.com/scopatz/nanorc
synced 2024-11-24 11:20:26 +01:00
lots of zsh improvements
This commit is contained in:
parent
05e2d6caf1
commit
79388bb0e9
29
zsh.nanorc
29
zsh.nanorc
|
@ -1,31 +1,36 @@
|
||||||
## Syntax highlighting for zsh scripts (initially copied from sh.nanorc)
|
## Syntax highlighting for ZSH scripts (initially copied from sh.nanorc)
|
||||||
syntax "zsh" "\.zsh[^\.]+?$"
|
syntax "zsh" "\.?zsh[^\.]+?$"
|
||||||
header "^#!.*/zsh"
|
header "^#!.*/zsh"
|
||||||
|
|
||||||
|
## Numbers
|
||||||
|
color brightwhite "[0-9]+"
|
||||||
|
|
||||||
## Function definition
|
## Function definition
|
||||||
icolor brightgreen "^[0-9A-Z_]+\(\)"
|
icolor brightgreen "^\s+?(function\s+)?[0-9A-Z_]+\s+?\(\)"
|
||||||
|
|
||||||
## Conditionals and control flow
|
## Conditionals and control flow
|
||||||
color green "\<(case|do|done|elif|else|esac|exit|fi|for|function|if|in|local|read|return|select|shift|then|time|until|while)\>"
|
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 "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
|
color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
|
||||||
## Conditional flags
|
## Conditional flags
|
||||||
color green "-[Ldefgruwx]\>"
|
color green "-[Ldefgruwx]\>"
|
||||||
color green "-(eq|ne|gt|lt|ge|le|s|n|z)\>"
|
color green "-(eq|ne|gt|lt|ge|le|s|n|z)\>"
|
||||||
|
|
||||||
## Bash-inherited / common linux commands
|
## Bash-inherited
|
||||||
color brightblue "\<(alias|bindkey|cat|cd|chmod|chown|cp|echo|env|export|grep|install|let|ln|make|mkdir|mv|rm|sed|set|source|tar|touch|umask|unset)\>"
|
color brightblue "\<(alias|bindkey|builtin|cd|eval|exec|export|jobs|let|popd|pushd|set|source|typeset|umask|unset)\>"
|
||||||
## zsh-specific
|
## ZSH-specific
|
||||||
color brightblue "\<(autoload|compinit|prompt(init)?|setopt|zmodload|zstyle)\>"
|
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)\>"
|
||||||
|
|
||||||
## Variables
|
## Variables
|
||||||
icolor brightred "\$\{?[0-9A-Z_!@#$*?-]+\}?"
|
icolor brightred "\$\{?[0-9A-Z_!@#$*?-]+\}?"
|
||||||
|
|
||||||
## Comments
|
|
||||||
color cyan "(^|[[:space:]])#.*$"
|
|
||||||
|
|
||||||
## Strings
|
## Strings
|
||||||
color brightyellow ""(\\.|[^"])*""
|
color brightyellow ""(\\.|[^"])*""
|
||||||
color brightyellow "'(\\.|[^'])*'"
|
color brightyellow "'(\\.|[^'])*'"
|
||||||
|
|
||||||
|
## Comments
|
||||||
|
color cyan "(^|[[:space:]])#.*$"
|
||||||
|
|
||||||
## Trailing spaces
|
## Trailing spaces
|
||||||
#color ,green "[[:space:]]+$"
|
color ,blue "[[:space:]]+$"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user