Skip to content

Commit

Permalink
adding tmbundle commands, syntax, prefs, and info.plisg
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyruppel committed Aug 23, 2010
1 parent a0fba22 commit 7117b63
Show file tree
Hide file tree
Showing 6 changed files with 314 additions and 0 deletions.
44 changes: 44 additions & 0 deletions Commands/Extend Class.tmCommand
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?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>#!/usr/bin/env ruby
require ENV['TM_SUPPORT_PATH'] + "/lib/ui"
class Object
def pass
yield self if block_given?
end
end
STDIN.readlines[ 0, ENV[ 'TM_LINE_NUMBER' ].to_i ].select { |line| line[ /^[a-zA-Z0-9\-]+/ ] }.pass do |s|
# don't offer the current symbol
s[ 0, s.size - 1 ].sort.pass do |symbols|
# let the user choose a symbol to extend
TextMate::UI.menu( symbols ).pass do |choice|
unless choice.nil?
puts "@extend #{symbols[ choice ]}"
end
end
end
end
</string>
<key>input</key>
<string>document</string>
<key>name</key>
<string>Extend Class</string>
<key>output</key>
<string>insertAsSnippet</string>
<key>scope</key>
<string>source.sass4as</string>
<key>tabTrigger</key>
<string>@</string>
<key>uuid</key>
<string>A1A90E2E-F82F-4681-A2A8-18EC4DDDF1A4</string>
</dict>
</plist>
48 changes: 48 additions & 0 deletions Commands/Insert Color___.tmCommand
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?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>#!/usr/bin/env ruby
require ENV['TM_SUPPORT_PATH'] + "/lib/ui"
require ENV['TM_SUPPORT_PATH'] + "/lib/exit_codes"
color = STDIN.read
if color.length &gt; 0 and color[0] != ?#
color.downcase!
end
color = TextMate::UI.request_color(color)
unless color.nil?
color.upcase!
if color.length == 3
color.gsub!(/(.)(.)(.)/,'\1\1\2\2\3\3')
end
print color
else
TextMate.exit_discard( )
end</string>
<key>fallbackInput</key>
<string>none</string>
<key>input</key>
<string>selection</string>
<key>keyEquivalent</key>
<string>@C</string>
<key>name</key>
<string>Insert Color...</string>
<key>output</key>
<string>replaceSelectedText</string>
<key>scope</key>
<string>source.sass4as</string>
<key>uuid</key>
<string>58E899DF-56AD-41E4-AF8D-6D23B9D0066C</string>
</dict>
</plist>
52 changes: 52 additions & 0 deletions Commands/List Variables.tmCommand
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?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>#!/usr/bin/env ruby
require ENV['TM_SUPPORT_PATH'] + "/lib/ui"
require ENV['TM_SUPPORT_PATH'] + "/lib/exit_codes"
class Object
def pass
yield self if block_given?
end
end
v = /^(\$[a-zA-Z0-9\-]+): ?(.*)/
STDIN.readlines[ 0, ENV[ 'TM_LINE_NUMBER' ].to_i ].select { |line|
line[ v ]
}.map { |m|
{ 'title' =&gt; m[ v, 1 ], 'data' =&gt; m[ v, 2 ] }
}.pass do |s|
case s.size
when 0
TextMate.exit_show_tool_tip "No variables declared before cursor in document."
when 1
print s[ 0 ][ 'title' ]
else
TextMate::UI.menu( s ).pass do |choice|
unless choice.nil?
print choice[ 'title' ]
end
end
end
end</string>
<key>input</key>
<string>document</string>
<key>name</key>
<string>List Variables</string>
<key>output</key>
<string>afterSelectedText</string>
<key>scope</key>
<string>source.sass4as</string>
<key>tabTrigger</key>
<string>$</string>
<key>uuid</key>
<string>7E854E2B-6BC2-4C57-9FE5-8C91B74B0300</string>
</dict>
</plist>
19 changes: 19 additions & 0 deletions Preferences/Symbol List: Classes.tmPreferences
Original file line number Diff line number Diff line change
@@ -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>name</key>
<string>Symbol List: Classes</string>
<key>scope</key>
<string>source.sass4as entity.name.tag.sass4as</string>
<key>settings</key>
<dict>
<key>showInSymbolList</key>
<integer>1</integer>
<key>symbolTransformation</key>
<string></string>
</dict>
<key>uuid</key>
<string>BA9EDF96-9420-4352-9FE4-0B334B57EBD5</string>
</dict>
</plist>
133 changes: 133 additions & 0 deletions Syntaxes/Sass4as.tmLanguage
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
<?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>fileTypes</key>
<array>
<string>sass</string>
</array>
<key>foldingStartMarker</key>
<string>\/\*</string>
<key>foldingStopMarker</key>
<string>\*\/</string>
<key>keyEquivalent</key>
<string>^~S</string>
<key>name</key>
<string>Sass4as</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\/\*.*\*\/</string>
<key>name</key>
<string>comment.line.sass4as</string>
</dict>
<dict>
<key>begin</key>
<string>\/\*</string>
<key>end</key>
<string>\*\/</string>
<key>name</key>
<string>comment.block.sass4as</string>
</dict>
<dict>
<key>match</key>
<string>\b(color|text-(?:indent|decoration|align)|display|kerning|font-(?:s(?:tyle|ize)|family|weight)|le(?:tter-spacing|ading)|margin-(?:left|right))\b</string>
<key>name</key>
<string>keyword.attribute.sass4as</string>
</dict>
<dict>
<key>match</key>
<string>^[a-zA-Z0-9\-]+</string>
<key>name</key>
<string>entity.name.tag.sass4as</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>support.function.sass4as</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>entity.name.tag.reference.sass4as</string>
</dict>
</dict>
<key>match</key>
<string>^ (@extend) ([a-zA-Z0-9\-]+)</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>variable.other.declaration.sass4as</string>
</dict>
</dict>
<key>match</key>
<string>^(\$[a-zA-Z0-9\-]+):</string>
</dict>
<dict>
<key>match</key>
<string>\$[a-zA-Z0-9\-]+$</string>
<key>name</key>
<string>variable.other.reference.sass4as</string>
</dict>
<dict>
<key>match</key>
<string>#[a-fA-F0-9]{6}</string>
<key>name</key>
<string>constant.color.sass4as</string>
</dict>
<dict>
<key>match</key>
<string>[\d\.]+(p(t|x)|em)</string>
<key>name</key>
<string>constant.font-size.sass4as</string>
</dict>
<dict>
<key>match</key>
<string>\t+</string>
<key>name</key>
<string>invalid.illegal.spacing.sass4as</string>
</dict>
<dict>
<key>match</key>
<string>;</string>
<key>name</key>
<string>invalid.illegal.character.sass4as</string>
</dict>
<dict>
<key>match</key>
<string>\b(s(erif|ans-serif)|center|no(ne|rmal)|true|i(nline|talic)|underline|justify|false|left|right|mono|b(old|lock))\b</string>
<key>name</key>
<string>support.constant.sass4as</string>
</dict>
<dict>
<key>begin</key>
<string>"</string>
<key>end</key>
<string>"</string>
<key>name</key>
<string>string.quoted.double.sass4as</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\\.</string>
<key>name</key>
<string>constant.character.escape.untitled</string>
</dict>
</array>
</dict>
</array>
<key>scopeName</key>
<string>source.sass4as</string>
<key>uuid</key>
<string>3047ACB7-2A58-4018-BC51-5C60E77AA19E</string>
</dict>
</plist>
18 changes: 18 additions & 0 deletions info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?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>name</key>
<string>Sass4as</string>
<key>ordering</key>
<array>
<string>58E899DF-56AD-41E4-AF8D-6D23B9D0066C</string>
<string>7E854E2B-6BC2-4C57-9FE5-8C91B74B0300</string>
<string>A1A90E2E-F82F-4681-A2A8-18EC4DDDF1A4</string>
<string>3047ACB7-2A58-4018-BC51-5C60E77AA19E</string>
<string>BA9EDF96-9420-4352-9FE4-0B334B57EBD5</string>
</array>
<key>uuid</key>
<string>898A10B7-27D0-47DF-B3AD-25CE3E3E4D45</string>
</dict>
</plist>

0 comments on commit 7117b63

Please sign in to comment.