-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbash.nanorc
More file actions
77 lines (53 loc) · 2.56 KB
/
Copy pathbash.nanorc
File metadata and controls
77 lines (53 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Syntax highlighting for Bash files.
syntax bash "\.(ba)?sh$"
header "^#!.*/(env +)?bash( |$)"
comment "#"
tabgives " "
# Builtin Commands.
# https://www.gnu.org/software/bash/manual/bash.html#Builtin-Index
color magenta "\. "
color magenta ":( |$)"
color magenta "(\[ | \])"
color magenta "\<(alias|bg|bind|break|builtin|caller|cd|command|compgen|complete|compopt|continue|declare|dirs|disown|echo|enable|eval|exec|exit|export|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|type|typeset|ulimit|umask|unalias|unset|wait)\>"
# Reserved Words.
# https://www.gnu.org/software/bash/manual/bash.html#Reserved-Word-Index
color blue "(! |\[\[ | \]\]|\{ |; \})"
color blue "\<(case|do|done|elif|else|esac|fi|for|function|if|in|select|then|time|until|while)\>"
# Parameter and Variable Index.
# https://www.gnu.org/software/bash/manual/bash.html#Variable-Index
color yellow "\$[!#$*0?@_-]"
# Control operators.
# https://www.gnu.org/software/bash/manual/bash.html#index-control-operator
color blue "(\|\||&&|&|;|;;|;&|;;&|\||\|&|\(|\))"
# Shell Expansions.
# https://www.gnu.org/software/bash/manual/bash.html#Shell-Expansions
# https://www.gnu.org/software/bash/manual/bash.html#Brace-Expansion
color blue "[{,}]"
# https://www.gnu.org/software/bash/manual/bash.html#Tilde-Expansion
color blue "~"
# https://www.gnu.org/software/bash/manual/bash.html#Shell-Parameter-Expansion
icolor yellow "\$[a-z_][0-9a-z_]*"
color yellow "\$\{[^}]+\}"
# https://www.gnu.org/software/bash/manual/bash.html#Command-Substitution
color blue "(\$\(|\)|`)"
# https://www.gnu.org/software/bash/manual/bash.html#Arithmetic-Expansion
color blue "(\$\(\( | \)\))"
# https://www.gnu.org/software/bash/manual/bash.html#Process-Substitution
color blue "(<\(|>\(|\))"
# Strings.
color green ""([^"\]|\\.)*""
color green "'[^']*'"
# Multiline strings.
# https://www.gnu.org/software/bash/manual/bash.html#index-name
color green start="(^| )((export +)?[A-Za-z_][0-9A-Za-z_]*=|echo +(-[neE]+ +)*)"([^"]|\\")*$" end="^([^"\]|\\.)*""
color green start="(^| )((export +)?[A-Za-z_][0-9A-Za-z_]*=|echo +(-[neE]+ +)*)'[^']*$" end="^[^']*'"
color normal "(^| )((export +)?[A-Za-z_][0-9A-Za-z_]*=|echo +(-[neE]+ +)*)"
color magenta "\<(export|echo)\>"
# Comments.
# https://www.gnu.org/software/bash/manual/bash.html#Comments
color red "^ *#.*$"
color red "[ ]#("([^"\]|\\.)*"|'([^'\]|\\.)*'|[^"'])*$"
# Here Documents.
color normal start="<<-?["']?E..["']? *$" end="^ *E.."
# Trailing whitespaces.
color ,green " +$"