mirror of
https://github.com/scopatz/nanorc
synced 2024-11-24 11:20:26 +01:00
make .zsh* highlighting significantly better (started from sh)
This commit is contained in:
parent
a376424640
commit
dcd55cddbd
2
nanorc
2
nanorc
|
@ -64,4 +64,4 @@ include ~/.nano/xml.nanorc
|
||||||
include ~/.nano/xresources.nanorc
|
include ~/.nano/xresources.nanorc
|
||||||
include ~/.nano/yaml.nanorc
|
include ~/.nano/yaml.nanorc
|
||||||
include ~/.nano/yum.nanorc
|
include ~/.nano/yum.nanorc
|
||||||
include ~/.nano/zshrc.nanorc
|
include ~/.nano/zsh.nanorc
|
||||||
|
|
31
zsh.nanorc
Normal file
31
zsh.nanorc
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
## Syntax highlighting for zsh scripts (initially copied from sh.nanorc)
|
||||||
|
syntax "zsh" "\.zsh[^\.]+?$"
|
||||||
|
header "^#!.*/zsh"
|
||||||
|
|
||||||
|
## Function definition
|
||||||
|
icolor brightgreen "^[0-9A-Z_]+\(\)"
|
||||||
|
|
||||||
|
## 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 "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
|
||||||
|
## Conditional flags
|
||||||
|
color green "-[Ldefgruwx]\>"
|
||||||
|
color green "-(eq|ne|gt|lt|ge|le|s|n|z)\>"
|
||||||
|
|
||||||
|
## Bash-inherited / common linux commands
|
||||||
|
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)\>"
|
||||||
|
## zsh-specific
|
||||||
|
color brightblue "\<(autoload|compinit|prompt(init)?|setopt|zmodload|zstyle)\>"
|
||||||
|
|
||||||
|
## Variables
|
||||||
|
icolor brightred "\$\{?[0-9A-Z_!@#$*?-]+\}?"
|
||||||
|
|
||||||
|
## Comments
|
||||||
|
color cyan "(^|[[:space:]])#.*$"
|
||||||
|
|
||||||
|
## Strings
|
||||||
|
color brightyellow ""(\\.|[^"])*""
|
||||||
|
color brightyellow "'(\\.|[^'])*'"
|
||||||
|
|
||||||
|
## Trailing spaces
|
||||||
|
#color ,green "[[:space:]]+$"
|
14
zshrc.nanorc
14
zshrc.nanorc
|
@ -1,14 +0,0 @@
|
||||||
## Hightlightings for zsh configuration files (most used keywords)
|
|
||||||
syntax "zshrc" "\.?zshrc$"
|
|
||||||
|
|
||||||
## Keywords
|
|
||||||
color red "\<(autoload|prompt(init)?|zstyle|zmodload|compinit|setopt|export|source)\>"
|
|
||||||
color magenta "\<(alias|bindkey|function)\>"
|
|
||||||
|
|
||||||
## Strings
|
|
||||||
icolor white ""(\\.|[^"])*""
|
|
||||||
icolor white "'(\\.|[^'])*'"
|
|
||||||
|
|
||||||
## Comments
|
|
||||||
icolor brightblue "^[[:space:]]*#.*$"
|
|
||||||
icolor cyan "^[[:space:]]*##.*$"
|
|
Loading…
Reference in New Issue
Block a user