1name = "Shell Script"
2code_fence_block_name = "bash"
3grammar = "bash"
4path_suffixes = ["sh", "bash", "bashrc", "bash_profile", "bash_aliases", "bash_logout", "bats", "profile", "zsh", "zshrc", "zshenv", "zsh_profile", "zsh_aliases", "zsh_histfile", "zlogin", "zprofile", ".env", "PKGBUILD", "APKBUILD"]
5line_comments = ["# "]
6first_line_pattern = '^#!.*\b(?:ash|bash|bats|dash|sh|zsh)\b'
7autoclose_before = "}])"
8brackets = [
9 { start = "[", end = "]", close = true, newline = false },
10 { start = "(", end = ")", close = true, newline = true },
11 { start = "{", end = "}", close = true, newline = true },
12 { start = "\"", end = "\"", close = true, newline = false, not_in = ["comment", "string"] },
13 { start = "'", end = "'", close = true, newline = false, not_in = ["string", "comment"] },
14 { start = "do", end = "done", close = false, newline = true, not_in = ["comment", "string"] },
15 { start = "then", end = "fi", close = false, newline = true, not_in = ["comment", "string"] },
16 { start = "then", end = "else", close = false, newline = true, not_in = ["comment", "string"] },
17 { start = "then", end = "elif", close = false, newline = true, not_in = ["comment", "string"] },
18 { start = "in", end = "esac", close = false, newline = true, not_in = ["comment", "string"] },
19]
20
21### WARN: the following is not working when you insert an `elif` just before an else
22### example: (^ is cursor after hitting enter)
23### ```
24### if true; then
25### foo
26### elif
27### ^
28### else
29### bar
30### fi
31### ```
32increase_indent_pattern = "(^|\\s+|;)(do|then|in|else|elif)\\b.*$"
33decrease_indent_pattern = "(^|\\s+|;)(fi|done|esac|else|elif)\\b.*$"
34# make sure to test each line mode & block mode