zsh.nanorc 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. ## Syntax highlighting for ZSH scripts (initially copied from sh.nanorc)
  2. syntax "zsh" "\.zsh[^\.]+$"
  3. header "^#!.*/(env +)?zsh( |$)"
  4. ## Numbers
  5. color brightyellow "\b[0-9]+\b"
  6. ## Conditionals and control flow
  7. color green "\<(always|case|do|done|elif|else|esac|exit|fi|for|function|if|in|local|read|return|select|shift|then|time|until|while)\>"
  8. color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
  9. ## Conditional flags
  10. color green "-[Ldefgruwx]\>"
  11. color green "-(eq|ne|gt|lt|ge|le|s|n|z)\>"
  12. ## Bash-inherited
  13. color brightblue "\<(alias|bindkey|builtin|cd|eval|exec|export|jobs|let|popd|pushd|set|source|typeset|umask|unset)\>"
  14. ## ZSH-specific
  15. color brightblue "\<(add-zsh-hook|autoload|compinit|echotc|emulate|print|prompt(init)?|setopt|zle|zmodload|zstyle)\>"
  16. ## Common linux commands
  17. color brightmagenta "\<(cat|chmod|chown|cp|cut|echo|env|false|find|grep|head|install|kill|less|ln|make|mkdir|mv|nice|pwd|rm|rmdir|sed|tar|true|touch|uname|wc|whoami)\>"
  18. ## Function definition
  19. icolor brightgreen "^\s+(function\s+)[0-9A-Z_]+\s+\(\)"
  20. ## Variables
  21. icolor brightred "\$\{?[0-9A-Z_!@#$*?-]+\}?"
  22. ## Strings
  23. color yellow ""(\\.|[^"])*""
  24. color yellow "'(\\.|[^'])*'"
  25. ## Comments
  26. color cyan "(^|[[:space:]])#.*$"
  27. color brightcyan "(^|[[:space:]])##.*$"
  28. ## Trailing spaces
  29. color ,blue "[[:space:]]+$"