%YAML 1.2
---
name: Git Attributes
file_extensions:
- gitattributes
scope: source.gitattributes
contexts:
main:
- include: comments
- include: patterns
comments:
- match: '^#.*$'
scope: comment.line.number-sign.gitattributes
patterns:
- match: '^(\S+)'
captures:
1: string.unquoted.pattern.gitattributes
push: attributes
attributes:
- match: '\s+([\w-]+)(=)(\S+)'
captures:
1: variable.other.attribute.gitattributes
2: punctuation.separator.gitattributes
3: string.unquoted.value.gitattributes
- match: '\s+(-)([\w-]+)'
captures:
1: keyword.operator.negation.gitattributes
2: variable.other.attribute.gitattributes
- match: '\s+([\w-]+)'
captures:
1: variable.other.attribute.gitattributes
- match: '\b(text|binary|auto|eol|crlf|ident|filter|diff|merge|whitespace|export-ignore|export-subst|delta|encoding|working-tree-encoding|linguist-vendored|linguist-generated|linguist-documentation|linguist-detectable|linguist-language)\b'
scope: support.constant.attribute.gitattributes
- match: '$'
pop: true