Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions HTML (Liquid).sublime-syntax
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: HTML (Liquid)
file_extensions:
- liquid
scope: text.html.liquid
contexts:
main:
- match: '{%-?\s*comment\s*-?%}'
push:
- meta_scope: comment.block.liquid
- match: '{%-?\s*endcomment\s*-?%}'
pop: true
- match: "{{-?"
push:
- meta_scope: punctuation.output.liquid
- match: "-?}}"
pop: true
- include: template_var
- match: "{%-?"
push:
- meta_scope: punctuation.tag.liquid
- match: "-?%}"
pop: true
- include: template_tag_name
- include: template_var
- include: scope:text.html.basic
- include: scope:source.json
- include: scope:source.js
- include: scope:source.css
assign_op:
- match: /=
scope: keyword.operator.assignment.augmented.liquid
logic_expression:
- match: /=
scope: keyword.operator.assignment.augmented.liquid
logic_op:
- match: \s+(and|or|not|contains|(\!\=|\=\=|<\=|>\=|<|>)\s+
scope: keyword.operator.logical.liquid
template_tag_name:
- match: '(?<={%)\s*(\w+)'
scope: entity.name.tag.liquid
- match: '(?<={%-)\s*(\w+)'
scope: entity.name.tag.liquid
template_var:
- match: '(\[)(\|)(?=[^\]]*)(?=\])'
captures:
2: invalid.illegal.filter.liquid
3: invalid.illegal.filter.liquid
- match: (?<=\s)(\+|\-|\/|\*)(?=\s)
scope: invalid.illegal.filter.liquid
- match: (false|true|nil)
scope: constant.language.liquid
- match: '(?=if|unless|elsif)\s*[^%}]+\s(in)\s'
captures:
3: invalid.illegal.operator.liquid
- match: \s+(and|or|not|contains|in|by|((\!|\=|\<|\>)\=))\s+
scope: keyword.operator.liquid
- match: '(?<=assign)([^\=]+)(\=\=+)'
captures:
2: invalid.illegal.assignment.liquid
- match: '\|\s+(?![\.0-9])[a-zA-Z0-9_-]+\:\s+'
scope: support.function.with-args.liquid
- match: '\|\s+(?![\.0-9])[a-zA-Z0-9_-]+\s+'
scope: support.function.without-args.liquid
- match: (?<=\s)(with|offset\:|limit\:)(?=\s)
scope: keyword.control.liquid
- match: (?<=include)(.*)(with\:|offset|limit)(?=\s)
captures:
2: invalid.illegal.argument.liquid
- match: (?<=\s)(\w+\:)(?=\:\s)
scope: invalid.illegal.liquid
- match: '"'
push:
- meta_scope: string.quoted.double.liquid
- match: '"'
pop: true
- match: "'"
push:
- meta_scope: string.quoted.single.liquid
- match: "'"
pop: true
- match: '(-|\+)?\s*[0-9]+(\.[0-9]+)?'
scope: constant.numeric.liquid
- match: \b(collection|product|linklist|linklists|order|link|customer|customer_address|line_item|shop|collections|page_title|template|image|blog|blogs|cart|pages|theme|themes|variant|items|comment|forloop|settings|schema|javascript|stylesheet)\b
scope: support.class.liquid
- match: \b(assets|author|body|body_raw|current|date|excerpt_raw|meta|next|pages|parent|posts|previous|site|tags|taxonomy|title|url)\b
scope: support.class.liquid
- match: ((?<=\w\:\s)\w+)
scope: variable.parameter.liquid
- match: (?<=\.)\w+\b
scope: support.variable.liquid
- match: \w+
scope: variable.other.liquid
7 changes: 7 additions & 0 deletions Snippets/endjavascript.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!-- See http://www.sublimetext.com/docs/snippets for more information -->
<snippet>
<content><![CDATA[{% endjavascript %}]]></content>
<tabTrigger>endjavascript</tabTrigger>
<scope>text.html.liquid</scope>
<description>endjavascript</description>
</snippet>
7 changes: 7 additions & 0 deletions Snippets/endschema.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!-- See http://www.sublimetext.com/docs/snippets for more information -->
<snippet>
<content><![CDATA[{% endschema %}]]></content>
<tabTrigger>endschema</tabTrigger>
<scope>text.html.liquid</scope>
<description>endschema</description>
</snippet>
7 changes: 7 additions & 0 deletions Snippets/endstylesheet.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!-- See http://www.sublimetext.com/docs/snippets for more information -->
<snippet>
<content><![CDATA[{% endstylesheet %}]]></content>
<tabTrigger>endstylesheet</tabTrigger>
<scope>text.html.liquid</scope>
<description>endstylesheet</description>
</snippet>
7 changes: 7 additions & 0 deletions Snippets/javascript.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!-- See http://www.sublimetext.com/docs/snippets for more information -->
<snippet>
<content><![CDATA[{% javascript %}$0{% endjavascript %}]]> </content>
<tabTrigger>javascript</tabTrigger>
<scope>text.html.liquid</scope>
<description>javascript</description>
</snippet>
7 changes: 7 additions & 0 deletions Snippets/schema.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!-- See http://www.sublimetext.com/docs/snippets for more information -->
<snippet>
<content><![CDATA[{% schema %}$0{% endschema %}]]> </content>
<tabTrigger>schema</tabTrigger>
<scope>text.html.liquid</scope>
<description>schema</description>
</snippet>
7 changes: 7 additions & 0 deletions Snippets/stylesheet.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!-- See http://www.sublimetext.com/docs/snippets for more information -->
<snippet>
<content><![CDATA[{% stylesheet %}$0{% endstylesheet %}]]> </content>
<tabTrigger>stylesheet</tabTrigger>
<scope>text.html.liquid</scope>
<description>stylesheet</description>
</snippet>
96 changes: 0 additions & 96 deletions Syntaxes/HTML (Liquid).YAML-tmLanguage

This file was deleted.

Loading