From 778a4929a84279fd5d90a5781a8105ecfb739cd4 Mon Sep 17 00:00:00 2001 From: Ahmed El Gabri Date: Sat, 17 Nov 2018 11:27:26 +0100 Subject: [PATCH] Add twig support --- .gitmodules | 3 + assets/syntaxes/HTML (Twig).sublime-syntax | 662 +++++++++++++++++++++ 2 files changed, 665 insertions(+) create mode 100644 assets/syntaxes/HTML (Twig).sublime-syntax diff --git a/.gitmodules b/.gitmodules index 0056ed35..0335cb46 100644 --- a/.gitmodules +++ b/.gitmodules @@ -97,3 +97,6 @@ [submodule "assets/themes/sublime-snazzy"] path = assets/themes/sublime-snazzy url = https://github.com/greggb/sublime-snazzy +[submodule "assets/syntaxes/HTML (Twig)"] + path = assets/syntaxes/HTML (Twig) + url = https://github.com/Anomareh/PHP-Twig.tmbundle.git diff --git a/assets/syntaxes/HTML (Twig).sublime-syntax b/assets/syntaxes/HTML (Twig).sublime-syntax new file mode 100644 index 00000000..fcedca32 --- /dev/null +++ b/assets/syntaxes/HTML (Twig).sublime-syntax @@ -0,0 +1,662 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: HTML (Twig) +file_extensions: + - twig + - html.twig +scope: text.html.twig +contexts: + main: + - match: '(<)([a-zA-Z0-9:]++)(?=[^>]*>)' + captures: + 1: punctuation.definition.tag.html + 2: entity.name.tag.html + push: + - meta_scope: meta.tag.any.html + - match: (>(<)/)(\2)(>) + captures: + 1: punctuation.definition.tag.html + 2: meta.scope.between-tag-pair.html + 3: entity.name.tag.html + 4: punctuation.definition.tag.html + pop: true + - include: tag-stuff + - match: (<\?)(xml) + captures: + 1: punctuation.definition.tag.html + 2: entity.name.tag.xml.html + push: + - meta_scope: meta.tag.preprocessor.xml.html + - match: (\?>) + captures: + 1: punctuation.definition.tag.html + 2: entity.name.tag.xml.html + pop: true + - include: tag-generic-attribute + - include: string-double-quoted + - include: string-single-quoted + - match: