Skip to content

Instantly share code, notes, and snippets.

@xen
Last active July 5, 2018 05:36
Show Gist options
  • Select an option

  • Save xen/d11451454820554cb61f20dcdad3a4b0 to your computer and use it in GitHub Desktop.

Select an option

Save xen/d11451454820554cb61f20dcdad3a4b0 to your computer and use it in GitHub Desktop.

Revisions

  1. xen revised this gist Feb 12, 2018. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions jinja.json
    Original file line number Diff line number Diff line change
    @@ -35,6 +35,11 @@
    "body": "{{ $0 }}",
    "description": "Complete Variable",
    },
    "{#": {
    "prefix": "{#",
    "body": "{# ${TM_SELECTED_TEXT:${1:text}} #}",
    "description": "Comment",
    },
    "extends": {
    "prefix": "extends",
    "body": "{% extends ${1:\"${2:template}\"} %}",
    @@ -64,5 +69,10 @@
    "prefix": "macro",
    "body": "{% macro ${1:name}(${2:args}) %}\n\t$3\n{% endmacro %}",
    "description": "Macro",
    },
    "raw": {
    "prefix": "raw",
    "body": "{% raw %}\n${TM_SELECTED_TEXT:${1:text}}\n{% endraw %}",
    "description": "Raw,"
    }
    }
  2. xen revised this gist Feb 12, 2018. 1 changed file with 14 additions and 0 deletions.
    14 changes: 14 additions & 0 deletions jinja.json
    Original file line number Diff line number Diff line change
    @@ -6,6 +6,20 @@
    ],
    "description": "i18n"
    },
    "gt": {
    "prefix": "gt",
    "body": [
    "{{ gettext('${TM_SELECTED_TEXT:${1:text}}') }}"
    ],
    "description": "Gettext"
    },
    "ngt": {
    "prefix": "ngt",
    "body": [
    "{{ ngettext('${TM_SELECTED_TEXT:${1:text}}') }}"
    ],
    "description": "Ngettext"
    },
    "block": {
    "prefix": "block",
    "body": "{% block ${1:name} %}\n\t$2\n{% endblock %}",
  3. xen revised this gist Feb 12, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion jinja.json
    Original file line number Diff line number Diff line change
    @@ -43,7 +43,7 @@
    },
    "elif": {
    "prefix": "elif",
    "body": "{% elif ${1:expr} %}\n\t$2\n{% endif %}",
    "body": "{% elif ${1:expr} %}\n\t",
    "description": "Elif",
    },
    "macro": {
  4. xen created this gist Feb 12, 2018.
    54 changes: 54 additions & 0 deletions jinja.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,54 @@
    {
    "i18n": {
    "prefix": "_",
    "body": [
    "{{ _('${TM_SELECTED_TEXT:${1:text}}') }}"
    ],
    "description": "i18n"
    },
    "block": {
    "prefix": "block",
    "body": "{% block ${1:name} %}\n\t$2\n{% endblock %}",
    "description": "Block",
    },
    "{%": {
    "prefix": "{%",
    "body": "{% $0 %}",
    "description": "Complete Block",
    },
    "{{": {
    "prefix": "{{",
    "body": "{{ $0 }}",
    "description": "Complete Variable",
    },
    "extends": {
    "prefix": "extends",
    "body": "{% extends ${1:\"${2:template}\"} %}",
    "description": "Extends",
    },
    "filter": {
    "prefix": "filter",
    "body": "{% filter ${1:filter} %}\n\t$2\n{% endfilter %}",
    "description": "Filter",
    },
    "for": {
    "prefix": "for",
    "body": "{% for ${1:item} in ${2:sequence} %}\n\t$3\n{% endfor %}",
    "description": "For",
    },
    "if": {
    "prefix": "if",
    "body": "{% if ${1:expr} %}\n\t$2\n{% endif %}",
    "description": "If",
    },
    "elif": {
    "prefix": "elif",
    "body": "{% elif ${1:expr} %}\n\t$2\n{% endif %}",
    "description": "Elif",
    },
    "macro": {
    "prefix": "macro",
    "body": "{% macro ${1:name}(${2:args}) %}\n\t$3\n{% endmacro %}",
    "description": "Macro",
    }
    }