mirror of
https://github.com/scopatz/nanorc
synced 2024-11-01 07:10:00 +01:00
3465607c5a
- [Batch] Fix that using "::" as comments sometimes failed - [html] Tabs give 2 spaces by default - [JS] Tabs give 2 spaces by default; Allow comments to be inline with code. - [Sh] Also highlight PKGBUILD; Fix `${v%tail}` not highlighted; Use shellcheck as linter
24 lines
1.3 KiB
Plaintext
24 lines
1.3 KiB
Plaintext
## Here is an example for Bourne shell scripts.
|
|
##
|
|
syntax "SH" "\.sh$" "\.ash$" "\.bashrc$" "bashrc$" "\.bash_aliases$" "bash_aliases$" "\.bash_functions$" "bash_functions$" "\.bash_login$" "\.bash_logout$" "\.bash_profile$" "bash_profile$" "\.profile$" "revise\..+$" "^PKGBUILD$"
|
|
header "^#!.*/(env +)?(ba|da|a)?sh( |$)"
|
|
magic "(POSIX|Bourne-Again) shell script.*text"
|
|
comment "#"
|
|
|
|
linter shellcheck --format=gcc
|
|
|
|
## 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)\>"
|
|
## builtins:
|
|
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+\(\)"
|
|
icolor brightred "\$\{?[0-9A-Z_!@#%$*?-]+\}?"
|
|
color brightyellow ""(\\.|[^"])*"" "'(\\.|[^'])*'"
|
|
color cyan "(^|[[:space:]])#.*$"
|
|
color ,green "[[:space:]]+$"
|