123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- name: 'Shell Script'
- scopeName: 'source.shell'
- type: 'tree-sitter'
- parser: 'tree-sitter-bash'
- fileTypes: [
- 'sh'
- 'bash'
- 'ksh'
- 'zsh'
- 'zsh-theme'
- 'zshenv'
- 'zlogin'
- 'zlogout'
- 'zprofile'
- 'zshrc'
- 'bashrc'
- 'bash_aliases'
- 'bash_profile'
- 'bash_login'
- 'profile'
- 'bash_logout'
- 'npmrc'
- 'PKGBUILD'
- 'install'
- 'cygport'
- 'bats'
- 'ebuild'
- ]
- injectionRegex: '^(bash|sh|BASH|SH)$'
- firstLineRegex: [
- # shebang line
- '^#!.*\\b(bash|sh)\\r?\\n'
- # vim modeline
- 'vim\\b.*\\bset\\b.*\\b(filetype|ft|syntax)=(sh|bash)'
- ]
- folds: [
- {
- type: 'heredoc_body'
- }
- {
- type: 'if_statement',
- start: {type: '"then"'}
- end: {type: ['elif_clause', 'else_clause']}
- }
- {
- type: 'elif_clause',
- start: {type: '"then"'}
- }
- {
- type: 'if_statement'
- start: {type: '"then"'}
- end: {index: -1}
- }
- {
- type: 'case_statement'
- start: {type: '"in"'}
- end: {index: -1}
- }
- {
- type: 'elif_clause'
- start: {type: 'then'}
- }
- {
- type: 'else_clause'
- start: {index: 0}
- }
- {
- type: 'case_item'
- start: {type: ')'}
- }
- {
- type: [
- 'array'
- 'do_group'
- 'subshell'
- 'expansion'
- 'test_command'
- 'compound_statement'
- 'process_substitution'
- 'command_substitution'
- ]
- start: {index: 0}
- end: {index: -1}
- }
- ]
- comments:
- start: '# '
- scopes:
- 'program': 'source.shell'
- 'comment': 'comment.block'
- 'string': 'string'
- 'raw_string': 'string'
- 'ansii_c_string': 'string'
- 'heredoc_body': 'string'
- 'heredoc_start': 'string'
- 'regex': 'string.regexp'
- '
- "$",
- expansion > "${",
- expansion > "}"
- ': 'punctuation.section.embedded'
- 'string > command_substitution': 'embedded.source'
- 'function_definition > word': 'entity.name.function'
- 'command_name': 'entity.name.function'
- 'file_descriptor': 'constant.numeric'
- 'command_name > word': [
- {match: '^(cd|echo|eval|exit|false|getopts|pushd|popd|return|set|shift|true)$', scopes: 'support.function'}
- ]
- 'test_operator': 'entity.other.attribute-name'
- 'word': [{match: '^-', scopes: 'entity.other.attribute-name'}]
- 'special_variable_name': 'variable.other.member'
- 'variable_name': 'variable.other.member'
- '"if"': 'keyword.control'
- '"fi"': 'keyword.control'
- '"then"': 'keyword.control'
- '"else"': 'keyword.control'
- '"elif"': 'keyword.control'
- '"for"': 'keyword.control'
- '"do"': 'keyword.control'
- '"done"': 'keyword.control'
- '"case"': 'keyword.control'
- '"esac"': 'keyword.control'
- '"in"': 'keyword.control'
- '"while"': 'keyword.control'
- '"until"': 'keyword.control'
- '"function"': 'keyword.control'
- '"local"': 'keyword.control'
- '"declare"': 'keyword.control'
- '"export"': 'keyword.control'
- '"readonly"': 'keyword.control'
- '"typeset"': 'keyword.control'
- '"unset"': 'keyword.control'
- '"unsetenv"': 'keyword.control'
- '"&"': 'keyword.operator'
- '"&&"': 'keyword.operator'
- '"|"': 'keyword.operator'
- '"||"': 'keyword.operator'
- '"<"': 'keyword.operator'
- '">"': 'keyword.operator'
- '">>"': 'keyword.operator'
- '"&>"': 'keyword.operator'
- '"&>>"': 'keyword.operator'
- '"<&"': 'keyword.operator'
- '">&"': 'keyword.operator'
- '"<<-"': 'keyword.operator'
- '"<<<"': 'keyword.operator'
|