mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
added two snippets for creating functions; matching tab/key triggers from JavaScript bundle
This commit is contained in:
28
extras/CoffeeScript.tmbundle/Commands/New Function.tmCommand
Normal file
28
extras/CoffeeScript.tmbundle/Commands/New Function.tmCommand
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>command</key>
|
||||
<string>cat <<SNIPPET
|
||||
${TM_SELECTED_TEXT:-$TM_CURRENT_WORD}: (\${1:args}) ->
|
||||
\$0
|
||||
|
||||
SNIPPET</string>
|
||||
<key>fallbackInput</key>
|
||||
<string>word</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>$
|
||||
</string>
|
||||
<key>name</key>
|
||||
<string>New Function</string>
|
||||
<key>output</key>
|
||||
<string>insertAsSnippet</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>uuid</key>
|
||||
<string>C5717DF2-7113-472F-B1AD-4623480C578A</string>
|
||||
</dict>
|
||||
19
extras/CoffeeScript.tmbundle/Snippets/Function.tmSnippet
Normal file
19
extras/CoffeeScript.tmbundle/Snippets/Function.tmSnippet
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>content</key>
|
||||
<string>${1:function_name}: (${2:argument}) ->
|
||||
${0:# body...}
|
||||
|
||||
</string>
|
||||
<key>name</key>
|
||||
<string>Function</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>fun</string>
|
||||
<key>uuid</key>
|
||||
<string>F2E2E79A-A85D-471D-9847-72AE40205942</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -4,6 +4,18 @@
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>CoffeeScript</string>
|
||||
<key>ordering</key>
|
||||
<array>
|
||||
<string>5B520980-A7D5-4E10-8582-1A4C889A8DE5</string>
|
||||
<string>17C8BFF6-25F2-4F00-8E7E-768D3D186A23</string>
|
||||
<string>C5D6C716-12FE-4CE8-A916-6CABEDE8AFE7</string>
|
||||
<string>D7ADBF4B-B25B-4CF6-8FC0-C4FB0C3DBE64</string>
|
||||
<string>419D24D8-0DD6-4D9A-8CA0-6D9CD740BEEC</string>
|
||||
<string>B087AF2F-8946-4EA9-8409-49E7C4A2EEF0</string>
|
||||
<string>0A92C6F6-4D73-4859-B38C-4CC19CBC191F</string>
|
||||
<string>C5717DF2-7113-472F-B1AD-4623480C578A</string>
|
||||
<string>F2E2E79A-A85D-471D-9847-72AE40205942</string>
|
||||
</array>
|
||||
<key>uuid</key>
|
||||
<string>A46E4382-F1AC-405B-8F22-65FF470F34D7</string>
|
||||
</dict>
|
||||
|
||||
Reference in New Issue
Block a user