Permalink
Browse files

* Added TerminalMate bundle

* Ignore build directory of TerminalMate plugin


git-svn-id: http://svn.textmate.org/trunk/Bundles/TerminalMate.tmbundle@5821 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
  • Loading branch information...
0 parents commit f7bc5bdacf42f5c6cf57ae932331c5a407b8bea3 Daniel Harple committed Oct 31, 2006
39 Commands/Load File.tmCommand
@@ -0,0 +1,39 @@
+<?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
+
+$LOAD_PATH &lt;&lt; "#{ENV['TM_BUNDLE_SUPPORT']}/lib"
+require "terminal_mate"
+
+file_ext = ENV["TERMINAL_MATE_FILE_EXTENSION"].to_s
+tm_filepath = ENV["TM_FILEPATH"]
+if tm_filepath.nil?
+ tmpfile = `mktemp -t TerminalMate`.chomp # Couldn't get Tempfile to work…
+ tmpfile += file_ext
+ File.open(tmpfile, "w") do |f| f.write(STDIN.read) end
+ file = tmpfile
+ File.chmod(0755, file) if file_ext == ".sh"
+else
+ file = tm_filepath
+end
+TerminalMate::Client.new.send("load_file", ENV["TM_SCOPE"], ENV["TERMINAL_MATE_LOAD"] % file)
+</string>
+ <key>input</key>
+ <string>document</string>
+ <key>keyEquivalent</key>
+ <string>^I</string>
+ <key>name</key>
+ <string>Load File</string>
+ <key>output</key>
+ <string>afterSelectedText</string>
+ <key>scope</key>
+ <string>source</string>
+ <key>uuid</key>
+ <string>964A0E53-3896-4EC6-AC15-038DC8FCEEE2</string>
+</dict>
+</plist>
26 Commands/New Terminal.tmCommand
@@ -0,0 +1,26 @@
+<?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
+$LOAD_PATH &lt;&lt; "#{ENV['TM_BUNDLE_SUPPORT']}/lib"
+require "terminal_mate"
+TerminalMate::Client.new.send("new", ENV["TM_SCOPE"], ENV["TM_PROJECT_DIRECTORY"], ENV["TERMINAL_MATE_NEW"])
+</string>
+ <key>input</key>
+ <string>none</string>
+ <key>keyEquivalent</key>
+ <string>^I</string>
+ <key>name</key>
+ <string>New Terminal</string>
+ <key>output</key>
+ <string>afterSelectedText</string>
+ <key>scope</key>
+ <string>source</string>
+ <key>uuid</key>
+ <string>8F305E73-F68F-4A5D-B04B-A8646F2CC695</string>
+</dict>
+</plist>
28 Commands/Paste Selection.tmCommand
@@ -0,0 +1,28 @@
+<?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
+$LOAD_PATH &lt;&lt; "#{ENV['TM_BUNDLE_SUPPORT']}/lib"
+require "terminal_mate"
+TerminalMate::Client.new.send("paste", ENV["TM_SCOPE"], STDIN.read)
+</string>
+ <key>fallbackInput</key>
+ <string>document</string>
+ <key>input</key>
+ <string>selection</string>
+ <key>keyEquivalent</key>
+ <string>^I</string>
+ <key>name</key>
+ <string>Paste Selection</string>
+ <key>output</key>
+ <string>discard</string>
+ <key>scope</key>
+ <string>source</string>
+ <key>uuid</key>
+ <string>3B47B103-857B-4A75-938B-4D57D4803BC2</string>
+</dict>
+</plist>
36 Preferences/Haskell.tmPreferences
@@ -0,0 +1,36 @@
+<?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>name</key>
+ <string>Haskell</string>
+ <key>scope</key>
+ <string>source.haskell</string>
+ <key>settings</key>
+ <dict>
+ <key>shellVariables</key>
+ <array>
+ <dict>
+ <key>name</key>
+ <string>TERMINAL_MATE_LOAD</string>
+ <key>value</key>
+ <string>:load %s</string>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>TERMINAL_MATE_NEW</string>
+ <key>value</key>
+ <string>ghci</string>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>TERMINAL_MATE_FILE_EXTENSION</string>
+ <key>value</key>
+ <string>.hs</string>
+ </dict>
+ </array>
+ </dict>
+ <key>uuid</key>
+ <string>893492E6-754F-440E-BA86-0A3EFC311839</string>
+</dict>
+</plist>
30 Preferences/Ocaml.tmPreferences
@@ -0,0 +1,30 @@
+<?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>name</key>
+ <string>Ocaml</string>
+ <key>scope</key>
+ <string>source.ocaml</string>
+ <key>settings</key>
+ <dict>
+ <key>shellVariables</key>
+ <array>
+ <dict>
+ <key>name</key>
+ <string>TERMINAL_MATE_LOAD</string>
+ <key>value</key>
+ <string></string>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>TERMINAL_MATE_NEW</string>
+ <key>value</key>
+ <string>ocaml</string>
+ </dict>
+ </array>
+ </dict>
+ <key>uuid</key>
+ <string>5CD9D96B-B721-4AFD-AD55-51788292619B</string>
+</dict>
+</plist>
30 Preferences/Python.tmPreferences
@@ -0,0 +1,30 @@
+<?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>name</key>
+ <string>Python</string>
+ <key>scope</key>
+ <string>source.python</string>
+ <key>settings</key>
+ <dict>
+ <key>shellVariables</key>
+ <array>
+ <dict>
+ <key>name</key>
+ <string>TERMINAL_MATE_LOAD</string>
+ <key>value</key>
+ <string></string>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>TERMINAL_MATE_NEW</string>
+ <key>value</key>
+ <string>python</string>
+ </dict>
+ </array>
+ </dict>
+ <key>uuid</key>
+ <string>A464AA15-5064-4A4D-9742-6BE2A5F3999B</string>
+</dict>
+</plist>
30 Preferences/Rails.tmPreferences
@@ -0,0 +1,30 @@
+<?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>name</key>
+ <string>Rails</string>
+ <key>scope</key>
+ <string>source.ruby.rails</string>
+ <key>settings</key>
+ <dict>
+ <key>shellVariables</key>
+ <array>
+ <dict>
+ <key>name</key>
+ <string>TERMINAL_MATE_LOAD</string>
+ <key>value</key>
+ <string>load "%s"</string>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>TERMINAL_MATE_NEW</string>
+ <key>value</key>
+ <string>./script/console</string>
+ </dict>
+ </array>
+ </dict>
+ <key>uuid</key>
+ <string>FA21F17D-ACEE-4FB7-BBDD-DA5590DEAD75</string>
+</dict>
+</plist>
30 Preferences/Ruby.tmPreferences
@@ -0,0 +1,30 @@
+<?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>name</key>
+ <string>Ruby</string>
+ <key>scope</key>
+ <string>source.ruby</string>
+ <key>settings</key>
+ <dict>
+ <key>shellVariables</key>
+ <array>
+ <dict>
+ <key>name</key>
+ <string>TERMINAL_MATE_LOAD</string>
+ <key>value</key>
+ <string>load "%s"</string>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>TERMINAL_MATE_NEW</string>
+ <key>value</key>
+ <string>irb</string>
+ </dict>
+ </array>
+ </dict>
+ <key>uuid</key>
+ <string>9A374A7A-22A2-4969-BF9B-46DE9B356A84</string>
+</dict>
+</plist>
36 Preferences/Shell.tmPreferences
@@ -0,0 +1,36 @@
+<?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>name</key>
+ <string>Shell</string>
+ <key>scope</key>
+ <string>source.shell</string>
+ <key>settings</key>
+ <dict>
+ <key>shellVariables</key>
+ <array>
+ <dict>
+ <key>name</key>
+ <string>TERMINAL_MATE_LOAD</string>
+ <key>value</key>
+ <string>%s</string>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>TERMINAL_MATE_NEW</string>
+ <key>value</key>
+ <string></string>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>TERMINAL_MATE_FILE_EXTENSION</string>
+ <key>value</key>
+ <string>.sh</string>
+ </dict>
+ </array>
+ </dict>
+ <key>uuid</key>
+ <string>D320A79B-16FC-4C77-AB73-EF0E737AEBD7</string>
+</dict>
+</plist>
19 Support/lib/terminal_mate.rb
@@ -0,0 +1,19 @@
+require "socket"
+
+module TerminalMate
+
+ class Client
+ def initialize
+ port = File.open(File.expand_path("~/Library/Application Support/TerminalMate/server.bin")) { |file|
+ Marshal.load(file)
+ }
+ @socket = TCPSocket.new("127.0.0.1", port)
+ end
+
+ def send(*args)
+ args.map! { |a| a.to_s } # map nils to an empty string
+ @socket.puts(*args)
+ end
+ end
+
+end
21 info.plist
@@ -0,0 +1,21 @@
+<?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>name</key>
+ <string>TerminalMate</string>
+ <key>ordering</key>
+ <array>
+ <string>A464AA15-5064-4A4D-9742-6BE2A5F3999B</string>
+ <string>9A374A7A-22A2-4969-BF9B-46DE9B356A84</string>
+ <string>5CD9D96B-B721-4AFD-AD55-51788292619B</string>
+ <string>8F305E73-F68F-4A5D-B04B-A8646F2CC695</string>
+ <string>964A0E53-3896-4EC6-AC15-038DC8FCEEE2</string>
+ <string>3B47B103-857B-4A75-938B-4D57D4803BC2</string>
+ <string>893492E6-754F-440E-BA86-0A3EFC311839</string>
+ <string>FA21F17D-ACEE-4FB7-BBDD-DA5590DEAD75</string>
+ </array>
+ <key>uuid</key>
+ <string>70BFE5F6-B10E-408A-B1F6-C7B1661638F9</string>
+</dict>
+</plist>

0 comments on commit f7bc5bd

Please sign in to comment.