snippets
snippets copied to clipboard
Trigger on context instead of tab?
I was hoping to implement this snippet in atom, but I can't find any support for triggering snippets based on context.
<?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:$TM_SELECTED_TEXT}}</string>
<key>keyEquivalent</key>
<string>#</string>
<key>name</key>
<string>Embedded Code — #{…}</string>
<key>scope</key>
<string>B:(string.quoted.double.ruby|string.interpolated.ruby) - string source</string>
<key>uuid</key>
<string>EEE6D060-C5A0-400D-A2E0-0835013C5365</string>
</dict>
</plist>
It will expand # to #{} when inside a ruby string without hitting tab. The current migration tool doesn't seem to be able to do this. apm init --package . --convert https://github.com/textmate/ruby.tmbundle.
Do you know what the B: part of the scope string is supposed to do?
Your guess is as good as mine :)
What did the apm init command convert this snippet to? Or did it just silently drop it?
It didn't do anything. I tired removing everything in the original snippets folder except this snippet which resulted in an empty snippets folder in the output bin.
Can you try changing the scope to (string.quoted.double.ruby|string.interpolated.ruby) - string source and see if that converts correctly?
Same thing ...
What about if the content is #{$1}?
Nope, nothing.