Skip to content

Commit d5ed27f

Browse files
committed
Add snippet to insert ${} in template strings
Also add macro to overwrite the `}` at the end when applicable.
1 parent 91bb821 commit d5ed27f

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

Macros/Overwrite } in #{ .. }.tmMacro

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>commands</key>
6+
<array>
7+
<dict>
8+
<key>command</key>
9+
<string>moveRight:</string>
10+
</dict>
11+
</array>
12+
<key>hideFromUser</key>
13+
<true/>
14+
<key>keyEquivalent</key>
15+
<string>}</string>
16+
<key>name</key>
17+
<string>Overwrite '}' in ${ .. }</string>
18+
<key>scope</key>
19+
<string>source.js string meta.embedded.line.js punctuation.section.embedded.end.js</string>
20+
<key>uuid</key>
21+
<string>9A836C03-5693-49FA-B587-6EAF76EE743A</string>
22+
</dict>
23+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>content</key>
6+
<string>\${${1:$TM_SELECTED_TEXT}}</string>
7+
<key>hideFromUser</key>
8+
<true/>
9+
<key>keyEquivalent</key>
10+
<string>$</string>
11+
<key>name</key>
12+
<string>Insert ${} - Template Strings</string>
13+
<key>scope</key>
14+
<string>B:string.quoted.other.template.js - string source</string>
15+
<key>uuid</key>
16+
<string>0DA0E112-971D-4D7F-B2C9-BCACE0CA61B3</string>
17+
</dict>
18+
</plist>

0 commit comments

Comments
 (0)