1
0
Fork 0
mirror of synced 2024-11-15 13:38:58 -05:00
ultimate-vim/sources_non_forked/vim-snippets/snippets/liquid.snippets

264 lines
5 KiB
Text
Raw Normal View History

2019-05-16 15:48:47 -04:00
# Port of Shopify Liquid Template Snippets
# https://marketplace.visualstudio.com/items?itemName=killalau.vscode-liquid-snippets
snippet if
{% if ${1:condition} %}
${0:${VISUAL}}
{% endif %}
snippet else
{% else %}
snippet elsif
{% elsif ${1:condition} %}
snippet ifelse
{% if ${1:condition} %}
${2}
{% else %}
${0}
{% endif %}
snippet unless
{% unless ${1:condition} %}
${0:${VISUAL}}
{% endunless %}
snippet case
{% case ${1:variable} %}
{% when ${2:condition} %}
${3}
{% else %}
${0}
{% endcase %}
snippet when
{% when ${1:condition} %}
${0}
snippet cycle
{% cycle '${1:odd}', '${2:even}' %}
snippet cyclegroup
{% cycle '${1:group name}': '${2:odd}', '${3:even}' %}
snippet for
{% for ${1:item} in ${2:collection} %}
${0}
{% endfor %}
snippet limit
limit: ${1:5}
snippet offset
offset: ${1:0}
snippet reversed
reversed
snippet break
{% break %}
snippet continue
{% continue %}
snippet tablerow
{% tablerow ${1:item} in ${2:collection} cols: ${3:2} %}
${0}
{% endtablerow %}
snippet assign
{% assign ${1:variable} = ${0:value} %}
snippet increment
{% increment ${0:variable} %}
snippet decrement
{% decrement ${0:variable} %}
snippet capture
{% capture ${1:variable} %}${0}{% endcapture %}
snippet include
{% include '${0:snippet}' %}
snippet includewith
{% include '${1:snippet}', ${2:variable}: ${0:value} %}
snippet section
{% section '${1:snippet}' %}
snippet raw
{% raw %}${0}{% endraw %}
snippet layout
{% layout '${1:layout}' %}
snippet layoutnone
{% layout none %}
snippet paginate
{% paginate ${1:collection.products} by ${2:12} %}
{% for ${3:product} in $1 %}
${0}
{% endfor %}
{% endpaginate %}
snippet schema
{% schema %}
{
${0}
}
{% endschema %}
snippet stylesheet
{% stylesheet %}
${0}
{% endstylesheet %}
snippet stylesheet_scss
{% stylesheet '${1:scss}' %}
${0}
{% endstylesheet %}
snippet javascript
{% javascript %}
${0}
{% endjavascript %}
snippet comment-
{%- comment -%}${0}{%- endcomment -%}
snippet if-
{%- if ${1:condition} -%}
${0:${VISUAL}}
{%- endif -%}
snippet else-
{%- else -%}
snippet elsif-
{%- elsif ${1:condition} -%}
snippet ifelse-
{%- if ${1:condition} -%}
${2}
{%- else -%}
${0}
{%- endif -%}
snippet unless-
{%- unless ${1:condition} -%}
${0:${VISUAL}}
{%- endunless -%}
snippet case-
{%- case ${1:variable} -%}
{%- when ${2:condition} -%}
${3}
{%- else -%}
${0}
{%- endcase -%}
snippet when-
{%- when ${1:condition} -%}
${0}
snippet cycle-
{%- cycle '${1:odd}', '${2:even}' -%}
snippet cyclegroup-
{%- cycle '${1:group name}': '${2:odd}', '${3:even}' -%}
snippet for-
{%- for ${1:item} in ${2:collection} -%}
${0}
{%- endfor -%}
snippet continue-
{%- continue -%}
snippet tablerow-
{%- tablerow ${1:item} in ${2:collection} cols: ${3:2} -%}
${0}
{%- endtablerow -%}
snippet assign-
{%- assign ${1:variable} = ${0:value} -%}
snippet capture-
{%- capture ${1:variable} -%}${0}{%- endcapture -%}
snippet include-
{%- include '${0:snippet}' -%}
snippet includewith-
{%- include '${1:snippet}', ${2:variable}: ${0:value} -%}
snippet join
| join: '${1:, }'
snippet first
| first
snippet last
| last
snippet concat
| concat: ${1:array}
snippet map
| map: '${1:key}'
snippet reverse
| reverse
snippet size
| size
snippet sort
| sort: '${1:key}'
snippet uniq
| uniq
snippet img_tag
| img_tag
snippet img_tag_param
| img_tag: '${1:alt}', '${2:class}'
snippet script_tag
| script_tag
snippet stylesheet_tag
| stylesheet_tag
snippet abs
| abs
snippet ceil
| ceil
snippet divided_by
| divided_by: ${1:2}
snippet floor
| floor
snippet minus
| minus: ${1:1}
snippet plus
| plus: ${1:1}
snippet round
| round: ${1:0}
snippet times
| times: ${1:1}
snippet modulo
| modulo: ${1:2}
snippet money
| money
snippet money_with_currency
| money_with_currency
snippet money_without_trailing_zeros
| money_without_trailing_zeros
snippet money_without_currency
| money_without_currency
snippet append
| append: '${1:string}'
snippet camelcase
| camelcase
snippet capitalize
| capitalize
snippet downcase
| downcase
snippet escape
| escape
snippet handleize
| handleize
snippet md5
| md5
snippet newline_to_br
| newline_to_br
snippet pluralize
| pluralize: '${1:item}', '${2:items}'
snippet prepend
| prepend: '${1:string}'
snippet remove
| remove: '${1:string}'
snippet remove_first
| remove_first: '${1:string}'
snippet replace
| replace: '${1:target}', '${2:replace}'
snippet replace_first
| replace_first: '${1:target}', '${2:replace}'
snippet slice
| slice: ${1:0}, ${2:5}
snippet slice_single
| slice: ${1:at}
snippet split
| split: '${1:,}'
snippet strip
| strip
snippet lstrip
| lstrip
snippet rstrip
| rstrip
snippet strip_html
| strip_html
snippet strip_newlines
| strip_newlines
snippet truncate
| truncate: ${1:20}, '${2:...}'
snippet truncatewords
| truncatewords: ${1:5}, '${2:...}'
snippet upcase
| upcase
snippet url_encode
| url_encode
snippet url_escape
| url_escape
snippet url_param_escape
| url_param_escape
snippet asset_url
| asset_url
snippet asset_img_url
| asset_img_url: '${1:medium}'
snippet img_url
| img_url: '${1:medium}'