-
Notifications
You must be signed in to change notification settings - Fork 587
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds basic snippets for template related interpolations. Examples: tif => {{ if | }} tifend => {{ if | }} ... {{ end }} telse => {{ else }} Triggers follow the scheme to prefix each valid template keyword with `t`.
- Loading branch information
Showing
18 changed files
with
143 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<snippet> | ||
<content><![CDATA[${TM_TEMPLATE_START}block "${1:name}"${TM_TEMPLATE_END} | ||
$0 | ||
${TM_TEMPLATE_START}end${TM_TEMPLATE_END}]]></content> | ||
<tabTrigger>tblockend</tabTrigger> | ||
<scope>(text.html.go | text.html.markdown.go | source.css.go | source.js.go | source.go string) - source.go.template</scope> | ||
<description>{{block "name"}} ... {{end}}</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[${TM_TEMPLATE_START}block "${1:name}"${TM_TEMPLATE_END}]]></content> | ||
<tabTrigger>tblock</tabTrigger> | ||
<scope>(text.html.go | text.html.markdown.go | source.css.go | source.js.go | source.go string) - source.go.template</scope> | ||
<description>{{block "name"}}</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[${TM_TEMPLATE_START}break${TM_TEMPLATE_END}]]></content> | ||
<tabTrigger>tbreak</tabTrigger> | ||
<scope>(text.html.go | text.html.markdown.go | source.css.go | source.js.go | source.go string) - source.go.template</scope> | ||
<description>{{break}}</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[${TM_TEMPLATE_START}continue${TM_TEMPLATE_END}]]></content> | ||
<tabTrigger>tcontinue</tabTrigger> | ||
<scope>(text.html.go | text.html.markdown.go | source.css.go | source.js.go | source.go string) - source.go.template</scope> | ||
<description>{{continue}}</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[${TM_TEMPLATE_START}define "${1:name}"${TM_TEMPLATE_END}]]></content> | ||
<tabTrigger>tdefine</tabTrigger> | ||
<scope>(text.html.go | text.html.markdown.go | source.css.go | source.js.go | source.go string) - source.go.template</scope> | ||
<description>{{define "name"}}</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[${TM_TEMPLATE_START}else if ${1:pipeline}${TM_TEMPLATE_END}]]></content> | ||
<tabTrigger>telseif</tabTrigger> | ||
<scope>(text.html.go | text.html.markdown.go | source.css.go | source.js.go | source.go string) - source.go.template</scope> | ||
<description>{{else if ...}}</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[${TM_TEMPLATE_START}else${TM_TEMPLATE_END}]]></content> | ||
<tabTrigger>telse</tabTrigger> | ||
<scope>(text.html.go | text.html.markdown.go | source.css.go | source.js.go | source.go string) - source.go.template</scope> | ||
<description>{{else}}</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[${TM_TEMPLATE_START}end${TM_TEMPLATE_END}]]></content> | ||
<tabTrigger>tend</tabTrigger> | ||
<scope>(text.html.go | text.html.markdown.go | source.css.go | source.js.go | source.go string) - source.go.template</scope> | ||
<description>{{end}}</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<snippet> | ||
<content><![CDATA[${TM_TEMPLATE_START}if ${1:pipeline}${TM_TEMPLATE_END} | ||
$0 | ||
${TM_TEMPLATE_START}end${TM_TEMPLATE_END}]]></content> | ||
<tabTrigger>tifend</tabTrigger> | ||
<scope>(text.html.go | text.html.markdown.go | source.css.go | source.js.go | source.go string) - source.go.template</scope> | ||
<description>{{if ...}} ... {{end}}</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[${TM_TEMPLATE_START}if ${1:pipeline}${TM_TEMPLATE_END}]]></content> | ||
<tabTrigger>tif</tabTrigger> | ||
<scope>(text.html.go | text.html.markdown.go | source.css.go | source.js.go | source.go string) - source.go.template</scope> | ||
<description>{{if ...}}</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[${TM_TEMPLATE_START}partial "${1:name}"${TM_TEMPLATE_END}]]></content> | ||
<tabTrigger>tpartial</tabTrigger> | ||
<scope>(text.html.go | text.html.markdown.go | source.css.go | source.js.go | source.go string) - source.go.template</scope> | ||
<description>{{partial "name"}}</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<snippet> | ||
<content><![CDATA[${TM_TEMPLATE_START}range ${1:pipeline}${TM_TEMPLATE_END} | ||
$0 | ||
${TM_TEMPLATE_START}end${TM_TEMPLATE_END}]]></content> | ||
<tabTrigger>trangeend</tabTrigger> | ||
<scope>(text.html.go | text.html.markdown.go | source.css.go | source.js.go | source.go string) - source.go.template</scope> | ||
<description>{{range ...}}...{{end}}</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[${TM_TEMPLATE_START}range ${1:pipeline}${TM_TEMPLATE_END}]]></content> | ||
<tabTrigger>trange</tabTrigger> | ||
<scope>(text.html.go | text.html.markdown.go | source.css.go | source.js.go | source.go string) - source.go.template</scope> | ||
<description>{{range ...}}</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[${TM_TEMPLATE_START}template "${1:header}" ${0:.}${TM_TEMPLATE_END}]]></content> | ||
<tabTrigger>ttemplate</tabTrigger> | ||
<scope>(text.html.go | text.html.markdown.go | source.css.go | source.js.go | source.go string) - source.go.template</scope> | ||
<description>{{template "name" .}}</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[${TM_TEMPLATE_START}.${0:Var}${TM_TEMPLATE_END}]]></content> | ||
<tabTrigger>tvar</tabTrigger> | ||
<scope>(text.html.go | text.html.markdown.go | source.css.go | source.js.go | source.go string) - source.go.template</scope> | ||
<description>{{.Var}}</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<snippet> | ||
<content><![CDATA[${TM_TEMPLATE_START}with ${1:pipeline}${TM_TEMPLATE_END} | ||
$0 | ||
${TM_TEMPLATE_START}end${TM_TEMPLATE_END}]]></content> | ||
<tabTrigger>twithend</tabTrigger> | ||
<scope>(text.html.go | text.html.markdown.go | source.css.go | source.js.go | source.go string) - source.go.template</scope> | ||
<description>{{with ...}}...{{end}}</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[${TM_TEMPLATE_START}with ${1:pipeline}${TM_TEMPLATE_END}]]></content> | ||
<tabTrigger>twith</tabTrigger> | ||
<scope>(text.html.go | text.html.markdown.go | source.css.go | source.js.go | source.go string) - source.go.template</scope> | ||
<description>{{with ...}}</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<plist version="1.0"> | ||
<dict> | ||
<!-- | ||
Template begin and end punctuation to wrap snippets into, | ||
when expanding within plain HTML, Markdown, CSS, JavaScript or Go strings. | ||
These variables are used to share snippets accross | ||
plain text and template source code and to be able to adjust | ||
whether templates are wrapped with whitespace. | ||
--> | ||
<key>scope</key> | ||
<string>(text.html.go | text.html.markdown.go | source.css.go | source.js.go | source.go string) - source.go.template</string> | ||
<key>settings</key> | ||
<dict> | ||
<key>shellVariables</key> | ||
<array> | ||
<dict> | ||
<key>name</key> | ||
<string>TM_TEMPLATE_START</string> | ||
<key>value</key> | ||
<string><![CDATA[{{ ]]></string> | ||
</dict> | ||
<dict> | ||
<key>name</key> | ||
<string>TM_TEMPLATE_END</string> | ||
<key>value</key> | ||
<string><![CDATA[ }}]]></string> | ||
</dict> | ||
</array> | ||
</dict> | ||
</dict> | ||
</plist> |