updated for new SCMenuItem implementation, also some updates to snippets/readme

This commit is contained in:
Rob Watson 2009-02-24 09:53:25 +00:00
parent 431bfd50f9
commit 508fb4719e
7 changed files with 99 additions and 38 deletions

View File

@ -10,7 +10,7 @@
def could_not_locate
puts "<span style='color:red'>There was a problem</span><br/>"
puts "Probably, you do not have SuperCollider installed, or you are using a non-standard user support directory.<br/><br/>"
puts "You will need to manually copy <code>supercollider-tmbundle/Support/classes/TextMate.sc</code> into your SC class path"
puts "You will need to manually link <code>supercollider-tmbundle/Support/classes/TextMate.sc</code> into your SC class path"
end
puts "=======================================<br/>"
@ -44,7 +44,7 @@ end
<key>keyEquivalent</key>
<string>$@</string>
<key>name</key>
<string>Install</string>
<string>Complete installation</string>
<key>output</key>
<string>showAsHTML</string>
<key>scope</key>

View File

@ -8,6 +8,8 @@ h2. Requirements
A "recent build":http://sourceforge.net/projects/supercollider of SC (>= 3.3 alpha)
"TextMate":http://macromates.com, with terminal usage enabled (see Help -> Terminal Usage in TM menu)
h2. Installation
h3. With git
@ -20,6 +22,10 @@ h3. With git
@osascript -e 'tell app "TextMate" to reload bundles'@
In Textmate menu: Bundles > SuperCollider > Complete installation
h3. Without git
@mkdir -p ~/Library/Application\ Support/TextMate/Bundles@
@ -36,13 +42,13 @@ h3. Without git
@osascript -e 'tell app "TextMate" to reload bundles'@
h3. After installing
In Textmate menu: Bundles > SuperCollider > Complete installation
* Open TextMate and select 'SuperCollider' bundle
* Press CMD-SHIFT-F1 to complete installation.
h2. Key controls
All key controls can be reprogrammed in Bundles editor.
* @ENTER@<br/>Execute current selection/line
* @CTRL-PERIOD@<br/>
@ -70,23 +76,25 @@ Post window to front
Clear post window
* @CMD-ALT-CTRL-S@<br/>
Switch to SuperCollider mode
Switch to SuperCollider bundle
<br/>
*plus* various snippets - check the bundle.
h2. Limitations
h2. Notes
TextMate does not handle .rtf documents. So .rtf files will have to be copy-and-pasted into .sc text files. This is not a problem for classes.
Some controls (browse class file, etc) depend upon TM terminal command (see Help -> Terminal Usage in TM menu)
CMD-period cannot be programmed in TextMate, so to stop audio output use CTRL-period instead
Class lib can only currently be recompiled from within TextMate (CMD-K) if there's been no previous error compiling it. Recompile from within SC in that case
h2. Notes
I've extracted the underlying code to allow control of SC.app from any command line application.<br/>"sc3ctrl on github":http://github.com/rfwatson/sc3ctrl
h2. TODO
Might repackage this as a quark .. ?
h2. Contact me
Via "github":http://github.com/rfwatson

16
Snippets/_isNil.tmSnippet Normal file
View File

@ -0,0 +1,16 @@
<?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>.isNil </string>
<key>name</key>
<string>.isNil</string>
<key>scope</key>
<string>source.supercollider</string>
<key>tabTrigger</key>
<string>.n</string>
<key>uuid</key>
<string>ABFD1872-DD86-4099-B758-28E319EF479D</string>
</dict>
</plist>

View File

@ -0,0 +1,16 @@
<?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>.notNil</string>
<key>name</key>
<string>.notNil</string>
<key>scope</key>
<string>source.supercollider</string>
<key>tabTrigger</key>
<string>.nn</string>
<key>uuid</key>
<string>A138C3A1-AEF7-4C4A-AD57-80B0564A61A8</string>
</dict>
</plist>

View File

@ -0,0 +1,14 @@
<?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>interpolation:</string>
<key>name</key>
<string>interpolation</string>
<key>tabTrigger</key>
<string>int</string>
<key>uuid</key>
<string>D36563CB-A0CE-43EB-8F19-2EF1D5E42B81</string>
</dict>
</plist>

View File

@ -23,36 +23,39 @@ TextMate {
};
try {
menu = CocoaMenuItem(nil, 7, "TextMate", true);
menu = SCMenuGroup(nil, "TextMate", 7);
opt = CocoaMenuItem(menu, 0, "TextMate to front", false) {
opt = SCMenuItem(menu, "TextMate to front")
.action_{
"osascript << END
tell application \"TextMate\" to activate
END
".unixCmd(postOutput: false)
};
opt.setShortCut("T");
}
.setShortCut("T");
openClassInTextMate = CocoaMenuItem(menu, 1, "Open class files in TextMate", false) { |item|
SCMenuSeparator(menu);
openClassInTextMate = SCMenuItem(menu, "Open class files in TextMate")
.action_{ |item|
item.state = item.state.not;
this.saveState;
};
openClassInTextMate.state = settings.classfiles;
}
.state_(settings.classfiles);
openReferencesInTextMate = CocoaMenuItem(menu, 2, "Open references in TextMate", false) { |item|
openReferencesInTextMate = SCMenuItem(menu, "Open references in TextMate")
.action_{ |item|
item.state = item.state.not;
this.saveState;
};
openReferencesInTextMate.state = settings.references;
}
.state_(settings.references);
CocoaMenuItem(menu, 3, "About SuperCollider bundle", false) { |item|
Document.new.string = "TextMate-SuperCollider bundle
SCMenuSeparator(menu, 4);
by R.Watson
For documentation and source code,
http://rfwatson.github.com"
};
SCMenuItem(menu, "About SuperCollider bundle")
.action_{ |item|
"open 'http://github.com/rfwatson/supercollider-tmbundle'".unixCmd(postOutput:false);
}
} {
"TextMate found a problem installing CocoaMenuItems - you may be running SC 3.2 or older, or booting from command-line.".warn
}

View File

@ -38,6 +38,10 @@
<string>293C4F9B-E1A4-4D01-83E7-0698112C7FA4</string>
<string>3BAE7DE4-D06A-422B-94A3-7F542C47ED0F</string>
<string>22917CBF-054E-49ED-8AFA-7B72C0CFFA3A</string>
<string>A138C3A1-AEF7-4C4A-AD57-80B0564A61A8</string>
<string>ABFD1872-DD86-4099-B758-28E319EF479D</string>
<string>BB37ACE9-8262-4AF6-B3C6-43DC0AF2B370</string>
<string>D36563CB-A0CE-43EB-8F19-2EF1D5E42B81</string>
</array>
<key>uuid</key>
<string>7613A472-3FAB-454C-8CF2-2E62F0D00920</string>