diff --git a/nanorc b/nanorc index ef30a6a..bc076cf 100644 --- a/nanorc +++ b/nanorc @@ -64,4 +64,4 @@ include ~/.nano/xml.nanorc include ~/.nano/xresources.nanorc include ~/.nano/yaml.nanorc include ~/.nano/yum.nanorc -include ~/.nano/zshrc.nanorc +include ~/.nano/zsh.nanorc diff --git a/zsh.nanorc b/zsh.nanorc new file mode 100644 index 0000000..cc8478a --- /dev/null +++ b/zsh.nanorc @@ -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:]]+$" diff --git a/zshrc.nanorc b/zshrc.nanorc deleted file mode 100644 index e5d4183..0000000 --- a/zshrc.nanorc +++ /dev/null @@ -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:]]*##.*$"