PeepOpen-Issues icon indicating copy to clipboard operation
PeepOpen-Issues copied to clipboard

Support TextMate 2 (no plugins available yet)

Open dmilith opened this issue 14 years ago • 28 comments

Is there any way to spawn Peep Open window from Tm2 through a bundle command?

dmilith avatar Dec 13 '11 16:12 dmilith

+1

seangaffney avatar Dec 13 '11 21:12 seangaffney

I haven't received a copy of TextMate 2 yet, but will try it out as soon as it's open to the public again.

I've heard that the problem is with activating TextMate from PeepOpen. See #273

topfunky avatar Dec 14 '11 06:12 topfunky

You may treat TM2 as TM1 without plugin support. I saw this feature done through ruby and it was tmbundle. Can You see for it in old peepOpen builds?

dmilith avatar Dec 15 '11 21:12 dmilith

@topfunky now that TM2 is open sourced can you look into this again?

Cheers

RobertLowe avatar Aug 14 '12 15:08 RobertLowe

+1

Would like to see tmbundle version of peepopen

karldanninger avatar Aug 16 '12 15:08 karldanninger

+1

carlosbrando avatar Aug 22 '12 01:08 carlosbrando

+1

wigsgiw avatar Aug 25 '12 08:08 wigsgiw

+1

joshgoebel avatar Sep 04 '12 03:09 joshgoebel

+1

9mm avatar Sep 04 '12 05:09 9mm

Patch PeepOpen's AppDelegate.rb as shown:

if customUrl.query
        # Don't try to gsub unless there is a query to work with.
        editorName = customUrl.query.gsub('editor=', '')
        editorName.gsub!("+"," ") # YOU ARE ADDING THIS LINE

Then you can add your own menu command to any TextMate 2 bundle manually such as:

#!/bin/sh
open "peepopen://${TM_PROJECT_DIRECTORY}?editor=TextMate+2"

This only seems to work if you pass the correct "TextMate 2" name to the binary (recompiling it first). I tried to just rename TextMate 2 to "TextMate2" and use the current release of PeepOpen but that didn't seem to do the trick. Perhaps it might if you dig around in the app's plist file or something, but that seems quite icky to maintain (since they are pushing out new builds every day).

I've emailed topfunky about getting this fix in the upstream binary so we can at least get it working pretty well until the official plugin/installer is fixed.

joshgoebel avatar Sep 04 '12 07:09 joshgoebel

I should clarify the plugin script alone will currently pop open PeepOpen, but it won't switch back to TextMate 2 unless you apply the patch and recompile the binary first. :(

joshgoebel avatar Sep 04 '12 07:09 joshgoebel

Hacked it.

defaults write com.topfunky.PeepOpen editorApplicationName "TextMate 2"

Any time you change any PeepOpen setting you'd have to rewrite this default. This "fixes" it be setting the default editor to "TextMate 2" so you don't have to pass the editor in the URL (which currently isn't possible because it contains a space).

Plugin command:

#!/bin/sh
open "peepopen://${TM_PROJECT_DIRECTORY}?editor="

joshgoebel avatar Sep 04 '12 07:09 joshgoebel

Of course you could probably add the defaults write command to the sh script as well... this shouldn't interfere with any other apps using PeepOpen as long as they are passing the editor in the URL.

joshgoebel avatar Sep 04 '12 07:09 joshgoebel

For the lazy:

https://github.com/yyyc514/PeepOpenTM2.tmbundle

This does just what I said above.

joshgoebel avatar Sep 04 '12 07:09 joshgoebel

Stupid question... where do custom .tmbundles go for textmate 2? I only see it's builtin option of installing existing ones from the server. I tried making folder and it didn't recognize it.

9mm avatar Sep 04 '12 15:09 9mm

Library/Application Support/Avian/Bundles I think

joshgoebel avatar Sep 04 '12 15:09 joshgoebel

Thanks, Josh. I'll try this out and issue a release.

topfunky avatar Sep 04 '12 16:09 topfunky

One could argue the binary plugin is better but I find the sh plugin way more than fast. So as long as TM_PROJECT_PATH or whatever can be trusted I'm not really sure the binary is necessary any longer. I've been using it for real coding today on a project and no issues so far.

Thanks, Josh Goebel

On Sep 4, 2012, at 12:09 PM, Geoffrey Grosenbach [email protected] wrote:

Thanks, Josh. I'll try this out and issue a release.

— Reply to this email directly or view it on GitHub.

joshgoebel avatar Sep 04 '12 23:09 joshgoebel

I stumbled upon this thread and tried the

https://github.com/yyyc514/PeepOpenTM2.tmbundle

bundle which didn't work.

After much googling I found that the name for TM2 is actually now 'TextMate' not 'TextMate 2' - just edit that in your bundle files and it worked fine.

wakiki avatar Jan 16 '14 17:01 wakiki

@wakiki It depends on what your executable is named. Mine is named "TextMate 2". Is the TextMate 2 download named "TextMate" now?

joshgoebel avatar Jan 21 '14 22:01 joshgoebel

@yyyc514 It is on mine, yes.

travisnewman avatar Feb 08 '14 16:02 travisnewman

I just submitted a pull request for what works on mine.

travisnewman avatar Feb 08 '14 16:02 travisnewman

@wakiki

Why were you trying my solution in the first place? The only reason I posted this was to deal with the name change... If the executable is named TextMate doesn't the built-in binary version provided with PeepOpen do the trick?

joshgoebel avatar Feb 18 '14 00:02 joshgoebel

I'm not @wakiki but I will say it did not work for me using the built-in version. I was only able to get it to work using the forked version that I submitted to you.

travisnewman avatar Feb 18 '14 02:02 travisnewman

Josh, no it didn't work in the first place, which is why I had to find an alternative solution. I can't remember exactly what problems I had, but changing the name in the forked repository did work.

Steve

On Tuesday, February 18, 2014, Josh Goebel [email protected] wrote:

@wakiki https://github.com/wakiki

Why were you trying my solution in the first place? The only reason I posted this was to deal with the name change... If the executable is named TextMate doesn't the built-in binary version provided with PeepOpen do the trick?

Reply to this email directly or view it on GitHubhttps://github.com/topfunky/PeepOpen-Issues/issues/272#issuecomment-35336713 .

wakiki avatar Feb 18 '14 08:02 wakiki

I've updated my repository to reflect the "TextMate" naming.

joshgoebel avatar Feb 27 '14 16:02 joshgoebel

Awesome, thanks @yyyc514

travisnewman avatar Feb 27 '14 16:02 travisnewman

Thanks!

On 27 February 2014 16:34, Josh Goebel [email protected] wrote:

I've updated my repository to reflect the "TextMate" naming.

Reply to this email directly or view it on GitHubhttps://github.com/topfunky/PeepOpen-Issues/issues/272#issuecomment-36261114 .

wakiki avatar Feb 27 '14 20:02 wakiki