1. Julian Mann
  2. mel.tmbundle

Commits

Julian Mann  committed 986c983

added some snippets, better help and made proc names.with.dots recognized

  • Participants
  • Parent commits 28440cf
  • Branches master

Comments (0)

Files changed (24)

File Commands/Command Help.tmCommand

View file
  • Ignore whitespace
+<?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># just to remind you of some useful environment variables
+# see Help / Environment Variables for the full list
+# echo File: "$TM_FILEPATH"
+# echo Word: "$TM_CURRENT_WORD"
+# echo Selection: "$TM_SELECTED_TEXT"
+
+#  echo Selection: "$TM_SELECTED_TEXT"
+
+open "/Applications/Autodesk/maya2009/docs/Maya2009/en_US/Commands/$TM_SELECTED_TEXT.html"
+
+# cat "/Applications/Autodesk/maya2009/docs/Maya2009/en_US/Commands/$TM_SELECTED_TEXT.html" </string>
+	<key>fallbackInput</key>
+	<string>none</string>
+	<key>input</key>
+	<string>selection</string>
+	<key>keyEquivalent</key>
+	<string>^h</string>
+	<key>name</key>
+	<string>Command Help</string>
+	<key>output</key>
+	<string>discard</string>
+	<key>scope</key>
+	<string>source.mel</string>
+	<key>uuid</key>
+	<string>A0624210-29A7-492D-85E5-518F50AD1AFF</string>
+</dict>
+</plist>

File Commands/Goto Clipboard Line File.tmCommand

View file
  • Ignore whitespace
+<?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 -w
+
+require 'find'
+require ENV['TM_SUPPORT_PATH'] + '/lib/textmate.rb'
+
+clipboard = `pbpaste`
+
+mel = clipboard.scan(/[a-z,A-Z,0-9,_\.]+\.mel/)
+line_column = clipboard.scan(/line [0-9]*\.?[0-9]*/)
+
+unless (mel.empty? || line_column.empty?)
+
+  line_column =  line_column.first.split(' ')[1]
+  line_column =  line_column.split('.')
+
+
+  mel = mel.first
+
+
+  Find.find(ENV["PWD"]) do |path|
+
+
+    if FileTest.directory?(path)
+      if File.basename(path)[0] == ?.
+        Find.prune   
+      else
+        next
+      end
+    else
+      if File.basename(path) == mel
+		if line_column.length == 2
+   			TextMate.go_to :file =&gt; path , :line =&gt; line_column[0], :column =&gt; line_column[1]
+		else
+			TextMate.go_to :file =&gt; path , :line =&gt; line_column[0]
+		end
+		exit
+		break
+      end
+    end
+  end
+puts "Couldn't Find #{mel}"
+else
+  puts "Not enough information in clipboard"
+end
+</string>
+	<key>input</key>
+	<string>selection</string>
+	<key>keyEquivalent</key>
+	<string>^e</string>
+	<key>name</key>
+	<string>Goto Clipboard Line File</string>
+	<key>output</key>
+	<string>showAsTooltip</string>
+	<key>scope</key>
+	<string>source.mel</string>
+	<key>uuid</key>
+	<string>126B1662-4422-45D9-8D6E-959897732FEF</string>
+</dict>
+</plist>

File Commands/Rake.tmCommand

View file
  • Ignore whitespace
+<?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 -w
+
+`rake`</string>
+	<key>input</key>
+	<string>selection</string>
+	<key>keyEquivalent</key>
+	<string>^R</string>
+	<key>name</key>
+	<string>Rake</string>
+	<key>output</key>
+	<string>showAsHTML</string>
+	<key>uuid</key>
+	<string>AE604D63-7CC7-4608-9B06-D2444415997C</string>
+</dict>
+</plist>

File Commands/Word Frequency.tmCommand

View file
  • Ignore whitespace
+<?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 -w
+
+require 'find'
+require ENV['TM_SUPPORT_PATH'] + '/lib/textmate.rb'
+
+proj = File.join(ENV["HOME"],"hq","dev","build_mama/")
+
+h = Hash.new
+Find.find(proj) do |path|
+  if FileTest.directory?(path)
+    if File.basename(path)[0] == ?.
+      Find.prune   
+    else
+      next
+    end
+  else
+    if File.extname(path) == ".mel"
+      f = File.open(path, "r")
+      f.each_line do |line|
+        words = line.split
+        words.each do |w|
+          if h.has_key?(w)
+            h[w] = h[w] + 1
+          else
+            h[w] = 1
+          end
+        end
+      end
+    end
+  end
+end
+# sort the hash by value, and then print it in this sorted order
+puts "Word Count in mel files under  #{proj}"
+h.sort{|a,b| a[1]&lt;=&gt;b[1]}.each { |elem|
+  puts "\"#{elem[0]}\" has #{elem[1]} occurrences" if (elem[1] &gt; 2)
+}
+
+</string>
+	<key>input</key>
+	<string>none</string>
+	<key>keyEquivalent</key>
+	<string>^w</string>
+	<key>name</key>
+	<string>Word Frequency</string>
+	<key>output</key>
+	<string>openAsNewDocument</string>
+	<key>scope</key>
+	<string>source.mel</string>
+	<key>uuid</key>
+	<string>5A56A1AC-2036-4FB9-B3DB-453FA40F0B40</string>
+</dict>
+</plist>

File Snippets/columnLayout.tmSnippet

View file
  • Ignore whitespace
+<?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>string $col = \`columnLayout -adj 1 ${1:layoutName}CL\`;
+seParent ..;</string>
+	<key>name</key>
+	<string>columnLayout</string>
+	<key>scope</key>
+	<string>source.mel</string>
+	<key>tabTrigger</key>
+	<string>col</string>
+	<key>uuid</key>
+	<string>EC684D03-3FFD-42A1-BED5-F07E59626D6E</string>
+</dict>
+</plist>

File Snippets/connectAttr.tmSnippet

View file
  • Ignore whitespace
+<?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>connectAttr -f (\$src+".${1:attr}") (\$dest+".${2:attr}") ;
+</string>
+	<key>name</key>
+	<string>connectAttr</string>
+	<key>tabTrigger</key>
+	<string>con</string>
+	<key>uuid</key>
+	<string>B1E1DD51-E237-4210-B4B7-C22C693FFF0F</string>
+</dict>
+</plist>

File Snippets/for $i.tmSnippet

View file
  • Ignore whitespace
+<?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>for (\$i=0;\$i&lt;\$n;\$i++){
+	$0
+}
+</string>
+	<key>name</key>
+	<string>for $i</string>
+	<key>scope</key>
+	<string>source.mel</string>
+	<key>tabTrigger</key>
+	<string>for</string>
+	<key>uuid</key>
+	<string>DCDAED4D-B74C-402E-8C0A-B52D09702871</string>
+</dict>
+</plist>

File Snippets/for $o in $nodes.tmSnippet

View file
  • Ignore whitespace
+<?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>for (\$node in \$nodes){
+	$0
+}
+</string>
+	<key>name</key>
+	<string>for $o in $nodes</string>
+	<key>scope</key>
+	<string>source.mel</string>
+	<key>tabTrigger</key>
+	<string>fin</string>
+	<key>uuid</key>
+	<string>E81EA462-CB80-4ACA-BC8A-4F55BC86CC72</string>
+</dict>
+</plist>

File Snippets/formLayout.tmSnippet

View file
  • Ignore whitespace
+<?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>string $form = \`formLayout  ${1:layoutName}Form\`;
+seParent ..;</string>
+	<key>name</key>
+	<string>formLayout</string>
+	<key>scope</key>
+	<string>source.mel</string>
+	<key>tabTrigger</key>
+	<string>fol</string>
+	<key>uuid</key>
+	<string>5C674A5B-C8D7-4249-8FAF-324D24DDE48A</string>
+</dict>
+</plist>

File Snippets/frameLayout.tmSnippet

View file
  • Ignore whitespace
+<?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>string $frame = \`frameLayout -l "${1:label}" ${2:layoutName}FL\`;
+seParent ..;</string>
+	<key>name</key>
+	<string>frameLayout</string>
+	<key>scope</key>
+	<string>source.mel</string>
+	<key>tabTrigger</key>
+	<string>frl</string>
+	<key>uuid</key>
+	<string>24B398F2-070F-4FC1-B757-DCEF264CFE1C</string>
+</dict>
+</plist>

File Snippets/global proc float array.tmSnippet

View file
  • Ignore whitespace
+<?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>global proc float[] ${1:procname}() {
+	float \$result[] = {};
+	$0
+	return \$result;
+}</string>
+	<key>name</key>
+	<string>global proc float array</string>
+	<key>scope</key>
+	<string>source.mel</string>
+	<key>tabTrigger</key>
+	<string>gfa</string>
+	<key>uuid</key>
+	<string>9549C3DD-217B-4169-8B9B-36C3FA8B5DFD</string>
+</dict>
+</plist>

File Snippets/global proc float.tmSnippet

View file
  • Ignore whitespace
+<?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>global proc float ${1:procname}() {
+	float \$result = 0.0;
+	$0
+	return \$result;
+}</string>
+	<key>name</key>
+	<string>global proc float</string>
+	<key>scope</key>
+	<string>source.mel</string>
+	<key>tabTrigger</key>
+	<string>gf</string>
+	<key>uuid</key>
+	<string>8E62F9E6-67D1-4297-9823-2D3F95DEDA81</string>
+</dict>
+</plist>

File Snippets/global proc int array.tmSnippet

View file
  • Ignore whitespace
+<?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>global proc int[] ${1:procname}() {
+	int \$result[] = 0;
+	$0
+	return \$result;
+}</string>
+	<key>name</key>
+	<string>global proc int array</string>
+	<key>scope</key>
+	<string>source.mel</string>
+	<key>tabTrigger</key>
+	<string>gia</string>
+	<key>uuid</key>
+	<string>7C0478D9-E2E1-4147-9B79-50B8CB5DEED2</string>
+</dict>
+</plist>

File Snippets/global proc int.tmSnippet

View file
  • Ignore whitespace
+<?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>global proc int ${1:procname}() {
+	int \$result = 0;
+	$0
+	return \$result;
+}</string>
+	<key>name</key>
+	<string>global proc int</string>
+	<key>scope</key>
+	<string>source.mel</string>
+	<key>tabTrigger</key>
+	<string>gi</string>
+	<key>uuid</key>
+	<string>65C0D149-1F49-4715-914C-1ABBB4A25D1A</string>
+</dict>
+</plist>

File Snippets/global proc string array.tmSnippet

View file
  • Ignore whitespace
+<?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>global proc string[] ${1:procname}() {
+	string \$result[] = {};
+	$0
+	return \$result;
+}</string>
+	<key>name</key>
+	<string>global proc string array</string>
+	<key>scope</key>
+	<string>source.mel</string>
+	<key>tabTrigger</key>
+	<string>gsa</string>
+	<key>uuid</key>
+	<string>A3C3460F-81DD-4542-AA8F-FFC4E21E873D</string>
+</dict>
+</plist>

File Snippets/global proc string.tmSnippet

View file
  • Ignore whitespace
+<?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>global proc string ${1:procname}() {
+	string \$result = "";
+	$0
+	return \$result;
+}</string>
+	<key>name</key>
+	<string>global proc string</string>
+	<key>scope</key>
+	<string>source.mel</string>
+	<key>tabTrigger</key>
+	<string>gs</string>
+	<key>uuid</key>
+	<string>6B8F30AF-78F5-4270-9BAB-1E44ED95394C</string>
+</dict>
+</plist>

File Snippets/ls dag leaf type.tmSnippet

View file
  • Ignore whitespace
+<?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>string \$nodes[] = \`ls -sl -dag -leaf -type "${1:type}"\`;
+
+</string>
+	<key>name</key>
+	<string>ls dag leaf type</string>
+	<key>scope</key>
+	<string>source.mel</string>
+	<key>tabTrigger</key>
+	<string>lt</string>
+	<key>uuid</key>
+	<string>3EBFFBA9-EEB1-4614-BC9D-F72D8A594B33</string>
+</dict>
+</plist>

File Snippets/print.tmSnippet

View file
  • Ignore whitespace
+<?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>print (\$${1:var} +"\\n");
+</string>
+	<key>name</key>
+	<string>print</string>
+	<key>scope</key>
+	<string>source.mel</string>
+	<key>tabTrigger</key>
+	<string>pt</string>
+	<key>uuid</key>
+	<string>7598FBA6-78FA-436F-A5FB-A38524EBE4EC</string>
+</dict>
+</plist>

File Snippets/return.tmSnippet

View file
  • Ignore whitespace
+<?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>return ${1:value};</string>
+	<key>name</key>
+	<string>return</string>
+	<key>tabTrigger</key>
+	<string>ret</string>
+	<key>uuid</key>
+	<string>E589E264-8646-49D1-B033-721AF9EE814B</string>
+</dict>
+</plist>

File Snippets/rowLayout.tmSnippet

View file
  • Ignore whitespace
+<?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>string $row = \`rowLayout  -nc ${1:2}  ${2:layoutName}RL\`;
+seParent ..;
+</string>
+	<key>name</key>
+	<string>rowLayout</string>
+	<key>scope</key>
+	<string>source.mel</string>
+	<key>tabTrigger</key>
+	<string>rol</string>
+	<key>uuid</key>
+	<string>3A9068CF-EECB-495D-AB9F-195A23865206</string>
+</dict>
+</plist>

File Snippets/string =.tmSnippet

View file
  • Ignore whitespace
+<?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>string \$${1:var} = ${2:expression};
+</string>
+	<key>name</key>
+	<string>string =</string>
+	<key>scope</key>
+	<string>source.mel</string>
+	<key>tabTrigger</key>
+	<string>str</string>
+	<key>uuid</key>
+	<string>E84B6EF6-D624-4101-8E46-1DE1A17630B2</string>
+</dict>
+</plist>

File Syntaxes/MEL.plist

View file
  • Ignore whitespace
 <?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">
+<!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>
 		</dict>
 		<dict>
 			<key>begin</key>
-			<string>((?:global\s*)?proc)\s*(\w+\s*\[?\]?\s+|\s+)([A-Za-z_][A-Za-z0-9_]*)\s*(\()</string>
+			<string>((?:global\s*)?proc)\s*(\w+\s*\[?\]?\s+|\s+)([A-Za-z_][A-Za-z0-9_\.]*)\s*(\()</string>
 			<key>beginCaptures</key>
 			<dict>
 				<key>1</key>

File Templates/script_mel.tmTemplate/info.plist

View file
  • Ignore whitespace
+<?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>if [[ ! -f "$TM_NEW_FILE" ]]; then
+   TM_YEAR=`date +%Y` \
+   TM_DATE=`date +%Y-%m-%d` \
+   perl -pe 's/\$\{([^}]*)\}/$ENV{$1}/g' \
+      &lt; template_in.txt &gt; "$TM_NEW_FILE"
+fi</string>
+	<key>extension</key>
+	<string>mel</string>
+	<key>name</key>
+	<string>script.mel</string>
+	<key>uuid</key>
+	<string>D5746182-A64E-4393-8C90-FE7B2741F645</string>
+</dict>
+</plist>

File Templates/script_mel.tmTemplate/template_in.mel

View file
  • Ignore whitespace
+//
+//  ${TM_NEW_FILE_BASENAME}
+//
+//  Created by ${TM_FULLNAME} on ${TM_DATE}.
+//  Copyright (c) ${TM_YEAR} ${TM_ORGANIZATION_NAME}. All rights reserved.
+//
+
+global proc  ${TM_NEW_FILE_BASENAME} () {
+
+}
+
+
+