From 79388bb0e986d8725b3485520995149d07ea56d5 Mon Sep 17 00:00:00 2001 From: MatthewCox Date: Wed, 16 Jul 2014 12:01:38 +0100 Subject: [PATCH] lots of zsh improvements --- zsh.nanorc | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/zsh.nanorc b/zsh.nanorc index cc8478a..cfc8a3c 100644 --- a/zsh.nanorc +++ b/zsh.nanorc @@ -1,31 +1,36 @@ -## Syntax highlighting for zsh scripts (initially copied from sh.nanorc) -syntax "zsh" "\.zsh[^\.]+?$" +## Syntax highlighting for ZSH scripts (initially copied from sh.nanorc) +syntax "zsh" "\.?zsh[^\.]+?$" header "^#!.*/zsh" +## Numbers +color brightwhite "[0-9]+" + ## Function definition -icolor brightgreen "^[0-9A-Z_]+\(\)" +icolor brightgreen "^\s+?(function\s+)?[0-9A-Z_]+\s+?\(\)" ## 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 "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)" ## 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)\>" +## 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)\>" ## Variables icolor brightred "\$\{?[0-9A-Z_!@#$*?-]+\}?" -## Comments -color cyan "(^|[[:space:]])#.*$" - ## Strings color brightyellow ""(\\.|[^"])*"" color brightyellow "'(\\.|[^'])*'" +## Comments +color cyan "(^|[[:space:]])#.*$" + ## Trailing spaces -#color ,green "[[:space:]]+$" +color ,blue "[[:space:]]+$"