Permalink
Browse files

some fixes to the windows batch script and other unused but possibly …

…useful in the future textmate files
  • Loading branch information...
1 parent 0c76495 commit 33f2b98713b1e3296e20eaf7f1e7d5fa753ca9b3 @n00ge n00ge committed Apr 12, 2011
View
@@ -0,0 +1 @@
+.DS_Store
@@ -0,0 +1,29 @@
+<?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>bundleUUID</key>
+ <string>467B298F-6227-11D9-BFB1-000D93589AF6</string>
+ <key>command</key>
+ <string>#!/usr/bin/env ruby
+require "#{ENV['TM_SUPPORT_PATH']}/lib/codecompletion"
+TextmateCodeCompletion.plist('Property Completions')
+</string>
+ <key>fallbackInput</key>
+ <string>line</string>
+ <key>input</key>
+ <string>selection</string>
+ <key>keyEquivalent</key>
+ <string>~</string>
+ <key>name</key>
+ <string>CodeCompletion CSS Properties</string>
+ <key>output</key>
+ <string>insertAsSnippet</string>
+ <key>scope</key>
+ <string>source.sass meta.property-list -meta.property-value</string>
+ <key>uuid</key>
+ <string>14303033-E209-489C-80A3-CAEDDD742576</string>
+</dict>
+</plist>
@@ -0,0 +1,40 @@
+<?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>bundleUUID</key>
+ <string>467B298F-6227-11D9-BFB1-000D93589AF6</string>
+ <key>command</key>
+ <string>#!/usr/bin/env ruby
+require "#{ENV['TM_SUPPORT_PATH']}/lib/codecompletion"
+preference = 'Property Value Completions'
+choices = []
+
+parsed_choices = TextmateCompletionsParser.new(nil, :scope =&gt; :css_values).to_ary
+choices += parsed_choices if parsed_choices
+
+choices += ['--']
+
+plist_choices = TextmateCompletionsPlist.new( "#{ENV['TM_BUNDLE_PATH']}/Preferences/#{preference}.tmPreferences" ).to_ary
+choices += plist_choices if plist_choices
+
+print TextmateCodeCompletion.new(choices,STDIN.read).to_snippet
+</string>
+ <key>fallbackInput</key>
+ <string>line</string>
+ <key>input</key>
+ <string>selection</string>
+ <key>keyEquivalent</key>
+ <string>~</string>
+ <key>name</key>
+ <string>CodeCompletion CSS Property Values</string>
+ <key>output</key>
+ <string>insertAsSnippet</string>
+ <key>scope</key>
+ <string>source.sass meta.property-value</string>
+ <key>uuid</key>
+ <string>4730374F-6919-416A-9042-64E026DED100</string>
+</dict>
+</plist>
@@ -0,0 +1,40 @@
+<?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>bundleUUID</key>
+ <string>467B298F-6227-11D9-BFB1-000D93589AF6</string>
+ <key>command</key>
+ <string>#!/usr/bin/env ruby
+require "#{ENV['TM_SUPPORT_PATH']}/lib/codecompletion"
+preference = 'Completions'
+choices = []
+
+parsed_choices = TextmateCompletionsParser.new(nil, :scope =&gt; :css).to_ary
+choices += parsed_choices if parsed_choices
+
+choices += ['--']
+
+plist_choices = TextmateCompletionsPlist.new( "#{ENV['TM_BUNDLE_PATH']}/Preferences/#{preference}.tmPreferences" ).to_ary
+choices += plist_choices if plist_choices
+
+print TextmateCodeCompletion.new(choices,STDIN.read, :scope =&gt; :css).to_snippet
+</string>
+ <key>fallbackInput</key>
+ <string>line</string>
+ <key>input</key>
+ <string>selection</string>
+ <key>keyEquivalent</key>
+ <string>~</string>
+ <key>name</key>
+ <string>CodeCompletion CSS</string>
+ <key>output</key>
+ <string>insertAsSnippet</string>
+ <key>scope</key>
+ <string>source.sass -meta.property-list</string>
+ <key>uuid</key>
+ <string>1CAA1F47-77F6-4B5E-B0F0-E5D54C56BCBC</string>
+</dict>
+</plist>
@@ -0,0 +1,172 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//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
+#
+# Lookup current word as a CSS property on w3c.org
+#
+# The mapping below was generated using:
+# echo '$props = {'; curl -s http://www.w3.org/TR/CSS2/propidx.html|egrep "(^|&lt;tr&gt;&lt;td&gt;)&lt;a href=\".*\" class=\"noxref\"&gt;&lt;span class=\".*\"&gt;'.*'&lt;/span&gt;&lt;/a&gt;"|perl -pe "s|(?:&lt;tr&gt;&lt;td&gt;)?&lt;a href=\"(.*)\" class=\"noxref\"&gt;&lt;span class=\".*\"&gt;'(.*)'&lt;/span&gt;&lt;/a&gt;|\t\"\$2\"\t=&gt; \"\$1\",|"; echo '}'
+
+$props = {
+ "azimuth" =&gt; "aural.html#propdef-azimuth",
+ "background" =&gt; "colors.html#propdef-background",
+ "background-attachment" =&gt; "colors.html#propdef-background-attachment",
+ "background-color" =&gt; "colors.html#propdef-background-color",
+ "background-image" =&gt; "colors.html#propdef-background-image",
+ "background-position" =&gt; "colors.html#propdef-background-position",
+ "background-repeat" =&gt; "colors.html#propdef-background-repeat",
+ "border" =&gt; "box.html#propdef-border",
+ "border-collapse" =&gt; "tables.html#propdef-border-collapse",
+ "border-color" =&gt; "box.html#propdef-border-color",
+ "border-spacing" =&gt; "tables.html#propdef-border-spacing",
+ "border-style" =&gt; "box.html#propdef-border-style",
+ "border-top" =&gt; "box.html#propdef-border-top",
+ "border-right" =&gt; "box.html#propdef-border-right",
+ "border-bottom" =&gt; "box.html#propdef-border-bottom",
+ "border-left" =&gt; "box.html#propdef-border-left",
+ "border-top-color" =&gt; "box.html#propdef-border-top-color",
+ "border-right-color" =&gt; "box.html#propdef-border-right-color",
+ "border-bottom-color" =&gt; "box.html#propdef-border-bottom-color",
+ "border-left-color" =&gt; "box.html#propdef-border-left-color",
+ "border-top-style" =&gt; "box.html#propdef-border-top-style",
+ "border-right-style" =&gt; "box.html#propdef-border-right-style",
+ "border-bottom-style" =&gt; "box.html#propdef-border-bottom-style",
+ "border-left-style" =&gt; "box.html#propdef-border-left-style",
+ "border-top-width" =&gt; "box.html#propdef-border-top-width",
+ "border-right-width" =&gt; "box.html#propdef-border-right-width",
+ "border-bottom-width" =&gt; "box.html#propdef-border-bottom-width",
+ "border-left-width" =&gt; "box.html#propdef-border-left-width",
+ "border-width" =&gt; "box.html#propdef-border-width",
+ "bottom" =&gt; "visuren.html#propdef-bottom",
+ "caption-side" =&gt; "tables.html#propdef-caption-side",
+ "clear" =&gt; "visuren.html#propdef-clear",
+ "clip" =&gt; "visufx.html#propdef-clip",
+ "color" =&gt; "colors.html#propdef-color",
+ "content" =&gt; "generate.html#propdef-content",
+ "counter-increment" =&gt; "generate.html#propdef-counter-increment",
+ "counter-reset" =&gt; "generate.html#propdef-counter-reset",
+ "cue" =&gt; "aural.html#propdef-cue",
+ "cue-after" =&gt; "aural.html#propdef-cue-after",
+ "cue-before" =&gt; "aural.html#propdef-cue-before",
+ "cursor" =&gt; "ui.html#propdef-cursor",
+ "direction" =&gt; "visuren.html#propdef-direction",
+ "display" =&gt; "visuren.html#propdef-display",
+ "elevation" =&gt; "aural.html#propdef-elevation",
+ "empty-cells" =&gt; "tables.html#propdef-empty-cells",
+ "float" =&gt; "visuren.html#propdef-float",
+ "font" =&gt; "fonts.html#propdef-font",
+ "font-family" =&gt; "fonts.html#propdef-font-family",
+ "font-size" =&gt; "fonts.html#propdef-font-size",
+ "font-size-adjust" =&gt; "fonts.html#propdef-font-size-adjust",
+ "font-stretch" =&gt; "fonts.html#propdef-font-stretch",
+ "font-style" =&gt; "fonts.html#propdef-font-style",
+ "font-variant" =&gt; "fonts.html#propdef-font-variant",
+ "font-weight" =&gt; "fonts.html#propdef-font-weight",
+ "height" =&gt; "visudet.html#propdef-height",
+ "left" =&gt; "visuren.html#propdef-left",
+ "letter-spacing" =&gt; "text.html#propdef-letter-spacing",
+ "line-height" =&gt; "visudet.html#propdef-line-height",
+ "list-style" =&gt; "generate.html#propdef-list-style",
+ "list-style-image" =&gt; "generate.html#propdef-list-style-image",
+ "list-style-position" =&gt; "generate.html#propdef-list-style-position",
+ "list-style-type" =&gt; "generate.html#propdef-list-style-type",
+ "margin" =&gt; "box.html#propdef-margin",
+ "margin-top" =&gt; "box.html#propdef-margin-top",
+ "margin-right" =&gt; "box.html#propdef-margin-right",
+ "margin-bottom" =&gt; "box.html#propdef-margin-bottom",
+ "margin-left" =&gt; "box.html#propdef-margin-left",
+ "marker-offset" =&gt; "generate.html#propdef-marker-offset",
+ "marks" =&gt; "page.html#propdef-marks",
+ "max-height" =&gt; "visudet.html#propdef-max-height",
+ "max-width" =&gt; "visudet.html#propdef-max-width",
+ "min-height" =&gt; "visudet.html#propdef-min-height",
+ "min-width" =&gt; "visudet.html#propdef-min-width",
+ "orphans" =&gt; "page.html#propdef-orphans",
+ "outline" =&gt; "ui.html#propdef-outline",
+ "outline-color" =&gt; "ui.html#propdef-outline-color",
+ "outline-style" =&gt; "ui.html#propdef-outline-style",
+ "outline-width" =&gt; "ui.html#propdef-outline-width",
+ "overflow" =&gt; "visufx.html#propdef-overflow",
+ "padding" =&gt; "box.html#propdef-padding",
+ "padding-top" =&gt; "box.html#propdef-padding-top",
+ "padding-right" =&gt; "box.html#propdef-padding-right",
+ "padding-bottom" =&gt; "box.html#propdef-padding-bottom",
+ "padding-left" =&gt; "box.html#propdef-padding-left",
+ "page" =&gt; "page.html#propdef-page",
+ "page-break-after" =&gt; "page.html#propdef-page-break-after",
+ "page-break-before" =&gt; "page.html#propdef-page-break-before",
+ "page-break-inside" =&gt; "page.html#propdef-page-break-inside",
+ "pause" =&gt; "aural.html#propdef-pause",
+ "pause-after" =&gt; "aural.html#propdef-pause-after",
+ "pause-before" =&gt; "aural.html#propdef-pause-before",
+ "pitch" =&gt; "aural.html#propdef-pitch",
+ "pitch-range" =&gt; "aural.html#propdef-pitch-range",
+ "play-during" =&gt; "aural.html#propdef-play-during",
+ "position" =&gt; "visuren.html#propdef-position",
+ "quotes" =&gt; "generate.html#propdef-quotes",
+ "richness" =&gt; "aural.html#propdef-richness",
+ "right" =&gt; "visuren.html#propdef-right",
+ "size" =&gt; "page.html#propdef-size",
+ "speak" =&gt; "aural.html#propdef-speak",
+ "speak-header" =&gt; "tables.html#propdef-speak-header",
+ "speak-numeral" =&gt; "aural.html#propdef-speak-numeral",
+ "speak-punctuation" =&gt; "aural.html#propdef-speak-punctuation",
+ "speech-rate" =&gt; "aural.html#propdef-speech-rate",
+ "stress" =&gt; "aural.html#propdef-stress",
+ "table-layout" =&gt; "tables.html#propdef-table-layout",
+ "text-align" =&gt; "text.html#propdef-text-align",
+ "text-decoration" =&gt; "text.html#propdef-text-decoration",
+ "text-indent" =&gt; "text.html#propdef-text-indent",
+ "text-shadow" =&gt; "text.html#propdef-text-shadow",
+ "text-transform" =&gt; "text.html#propdef-text-transform",
+ "top" =&gt; "visuren.html#propdef-top",
+ "unicode-bidi" =&gt; "visuren.html#propdef-unicode-bidi",
+ "vertical-align" =&gt; "visudet.html#propdef-vertical-align",
+ "visibility" =&gt; "visufx.html#propdef-visibility",
+ "voice-family" =&gt; "aural.html#propdef-voice-family",
+ "volume" =&gt; "aural.html#propdef-volume",
+ "white-space" =&gt; "text.html#propdef-white-space",
+ "widows" =&gt; "page.html#propdef-widows",
+ "width" =&gt; "visudet.html#propdef-width",
+ "word-spacing" =&gt; "text.html#propdef-word-spacing",
+ "z-index" =&gt; "visuren.html#propdef-z-index",
+}
+
+cur_line = ENV['TM_CURRENT_LINE']
+cur_word = ENV['TM_CURRENT_WORD']
+
+# since dash (‘-’) is not a word character, extend current word to neighboring word and dash characters
+$prop_name = /[-\w]*#{Regexp.escape cur_word}[-\w]*/.match(cur_line)[0]
+
+def request_prop_name
+ s = `\"#{ENV['TM_SUPPORT_PATH']}/bin/CocoaDialog.app/Contents/MacOS/CocoaDialog\" inputbox --title 'Documentation for Property' --informative-text 'What property would you like to lookup?' --text '#{$prop_name}' --button1 'Lookup' --button2 'Cancel' --button3 'Show All Properties'`
+ case (a = s.split("\n"))[0].to_i
+ when 1 then $props[a[1].to_s] || "propidx.html"
+ when 2 then abort "&lt;script&gt;window.close()&lt;/script&gt;"
+ when 3 then "propidx.html"
+ end
+end
+
+prop_url = $props[$prop_name] || request_prop_name
+url = "http://www.w3.org/TR/CSS2/" + prop_url
+puts "&lt;meta http-equiv='Refresh' content='0;URL=#{url}'&gt;"
+</string>
+ <key>input</key>
+ <string>none</string>
+ <key>keyEquivalent</key>
+ <string>^h</string>
+ <key>name</key>
+ <string>Documentation for Property</string>
+ <key>output</key>
+ <string>showAsHTML</string>
+ <key>scope</key>
+ <string>source.sass</string>
+ <key>uuid</key>
+ <string>E2CC7D28-9F0B-4BBB-ACE0-E67682DF3889</string>
+</dict>
+</plist>
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//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>bundleUUID</key>
+ <string>4675F24E-6227-11D9-BFB1-000D93589AF6</string>
+ <key>command</key>
+ <string>#!/usr/bin/env ruby
+
+prefix, def_col = '#', ''
+if STDIN.read =~ /(#?)([0-9A-Fa-f]{6})/ then
+ prefix = $1
+ rgb = $2.scan(/../).map { |i| i.hex * 257 }
+ def_col = ' default color {' + rgb.join(",") + '}'
+end
+
+col = `osascript 2&gt;/dev/null -e 'tell app "TextMate" to choose color#{def_col}'`
+exit 200 if col == ""
+
+col = col.split(",").map { |i| i.to_i / 257 }
+printf '%s%02X%02X%02X', prefix, *col
+</string>
+ <key>fallbackInput</key>
+ <string>word</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.sass</string>
+ <key>uuid</key>
+ <string>15DB6DEF-1236-4781-AC58-D5D7B8A76727</string>
+</dict>
+</plist>
@@ -0,0 +1,27 @@
+<?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>cd "$TM_BUNDLE_PATH"
+
+echo "&lt;pre&gt;"
+[ -d ".svn" ] &amp;&amp; svn up
+[ -d ".git" ] &amp;&amp; git pull
+[ ! -d .svn ] &amp;&amp; [ ! -d .git ] &amp;&amp; echo "You must install the bundle using Subversion or Git in order to update via this command."
+
+osascript -e 'tell app "TextMate" to reload bundles'
+
+echo "&lt;/pre&gt;"</string>
+ <key>input</key>
+ <string>selection</string>
+ <key>name</key>
+ <string>Update Bundle</string>
+ <key>output</key>
+ <string>showAsHTML</string>
+ <key>uuid</key>
+ <string>3FB1865C-21D8-47B5-9059-670FFC58DFCF</string>
+</dict>
+</plist>
@@ -0,0 +1,25 @@
+<?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>command</key>
+ <string>img="$TM_DROPPED_FILE"
+echo -n $img
+</string>
+ <key>draggedFileExtensions</key>
+ <array>
+ <string>png</string>
+ <string>jpeg</string>
+ <string>jpg</string>
+ <string>gif</string>
+ </array>
+ <key>name</key>
+ <string>Insert Image path</string>
+ <key>output</key>
+ <string>insertAsSnippet</string>
+ <key>scope</key>
+ <string>source.sass</string>
+ <key>uuid</key>
+ <string>131416B9-6C23-46DF-8B0F-3A6FB7922EBC</string>
+</dict>
+</plist>
Oops, something went wrong.

0 comments on commit 33f2b98

Please sign in to comment.