From f1d9ca85cc777561e71b52bee02a574881ff1604 Mon Sep 17 00:00:00 2001 From: MatthewCox Date: Wed, 16 Jul 2014 12:55:37 +0100 Subject: [PATCH] move sh and zsh function definition highlighters after the keywords (as they can override) --- sh.nanorc | 2 +- zsh.nanorc | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sh.nanorc b/sh.nanorc index 2f34a04..abf6619 100644 --- a/sh.nanorc +++ b/sh.nanorc @@ -3,12 +3,12 @@ syntax "sh" "\.sh$" "\.bashrc" "bashrc" "\.bash_aliases" "bash_aliases" "\.bash_functions" "bash_functions" "\.bash_profile" "bash_profile" header "^#!.*/(env +)?(ba)?sh( |$)" -icolor brightgreen "^[0-9A-Z_]+\(\)" 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 "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)" color green "-[Ldefgruwx]\>" color green "-(eq|ne|gt|lt|ge|le|s|n|z)\>" color brightblue "\<(cat|cd|chmod|chown|cp|echo|env|export|grep|install|let|ln|make|mkdir|mv|rm|sed|set|tar|touch|umask|unset)\>" +icolor brightgreen "^\s+?[0-9A-Z_]+\s+?\(\)" icolor brightred "\$\{?[0-9A-Z_!@#$*?-]+\}?" color brightyellow ""(\\.|[^"])*"" "'(\\.|[^'])*'" color cyan "(^|[[:space:]])#.*$" diff --git a/zsh.nanorc b/zsh.nanorc index 797fd8e..42f3305 100644 --- a/zsh.nanorc +++ b/zsh.nanorc @@ -5,9 +5,6 @@ header "^#!.*/(env +)?zsh( |$)" ## Numbers color brightwhite "[0-9]+" -## Function definition -icolor brightgreen "^\s+?(function\s+)?[0-9A-Z_]+\s+?\(\)" - ## Conditionals and control flow 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 "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)" @@ -22,6 +19,9 @@ color brightblue "\<(add-zsh-hook|autoload|compinit|echotc|emulate|print|prompt( ## 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)\>" +## Function definition +icolor brightgreen "^\s+?(function\s+)?[0-9A-Z_]+\s+?\(\)" + ## Variables icolor brightred "\$\{?[0-9A-Z_!@#$*?-]+\}?"