From 5ca686ee690ea60dd02c197be1c3f228bae38b96 Mon Sep 17 00:00:00 2001 From: Ross Smith II Date: Wed, 5 Jun 2019 23:27:13 -0700 Subject: [PATCH 1/2] Update sh.nanord with all keyword/builtins --- sh.nanorc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sh.nanorc b/sh.nanorc index a3854c9..42afa6e 100644 --- a/sh.nanorc +++ b/sh.nanorc @@ -1,13 +1,16 @@ ## Here is an example for Bourne shell scripts. ## -syntax "SH" "\.sh$" "\.bashrc" "bashrc" "\.bash_aliases" "bash_aliases" "\.bash_functions" "bash_functions" "\.bash_profile" "bash_profile" "revise\..+$" +syntax "SH" "\.sh$" "\.bashrc" "bashrc" "\.bash_aliases" "bash_aliases" "\.bash_functions" "bash_functions" "\.bash_login" "\.bash_logout" "\.bash_profile" "bash_profile" "\.profile" "revise\..+$" header "^#!.*/(env +)?(ba)?sh( |$)" - -color green "\<(case|do|done|elif|else|esac|exit|fi|for|function|if|in|local|read|return|select|shift|then|time|until|while)\>" +## keywords: +color green "\<(case|do|done|elif|else|esac|fi|for|function|if|in|select|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)\>" +## builtins: +color brightblue "\<(alias|bg|bind|break|builtin|cd|command|compgen|complete|continue|declare|dirs|disown|echo|enable|eval|exec|exit|export|fc|fg|getopts|hash|help|history|jobs|kill|let|local|logout|popd|printf|pushd|pwd|read|readonly|return|set|shift|shopt|source|suspend|test|times|trap|type|typeset|ulimit|umask|unalias|unset|wait)\>" +## not buitins: +## cat|chmod|chown|cp|env|grep|install|ln|make|mkdir|mv|rm|sed|tar|touch icolor brightgreen "^\s+[0-9A-Z_]+\s+\(\)" icolor brightred "\$\{?[0-9A-Z_!@#$*?-]+\}?" color brightyellow ""(\\.|[^"])*"" "'(\\.|[^'])*'" From c57d1f7911afd4c960bab13504d5b1dec91f9190 Mon Sep 17 00:00:00 2001 From: Ross Smith II Date: Wed, 5 Jun 2019 23:40:13 -0700 Subject: [PATCH 2/2] Add missing builtins to sh.nanorc See http://manpages.ubuntu.com/manpages/disco/man7/bash-builtins.7.html#synopsis --- sh.nanorc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sh.nanorc b/sh.nanorc index 42afa6e..4eeb07d 100644 --- a/sh.nanorc +++ b/sh.nanorc @@ -8,7 +8,7 @@ color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)" color green "-[Ldefgruwx]\>" color green "-(eq|ne|gt|lt|ge|le|s|n|z)\>" ## builtins: -color brightblue "\<(alias|bg|bind|break|builtin|cd|command|compgen|complete|continue|declare|dirs|disown|echo|enable|eval|exec|exit|export|fc|fg|getopts|hash|help|history|jobs|kill|let|local|logout|popd|printf|pushd|pwd|read|readonly|return|set|shift|shopt|source|suspend|test|times|trap|type|typeset|ulimit|umask|unalias|unset|wait)\>" +color brightblue "\<(alias|bg|bind|break|builtin|caller|cd|command|compgen|complete|compopt|continue|declare|dirs|disown|echo|enable|eval|exec|exit|export|false|fc|fg|getopts|hash|help|history|jobs|kill|let|local|logout|mapfile|popd|printf|pushd|pwd|read|readarray|readonly|return|set|shift|shopt|source|suspend|test|times|trap|true|type|typeset|ulimit|umask|unalias|unset|wait)\>" ## not buitins: ## cat|chmod|chown|cp|env|grep|install|ln|make|mkdir|mv|rm|sed|tar|touch icolor brightgreen "^\s+[0-9A-Z_]+\s+\(\)"