“Sort Lines in Selection” for Xcode 4

前端 未结 5 1575
孤街浪徒
孤街浪徒 2021-02-01 20:09

I like Textmate\'s \"Sort Lines in Selection\" feature a lot. Is there something similar for Xcode 4? If not, what would be the best way to integrate such a feature (a plugin, A

5条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-01 20:46

    How

    In TextMate, open the bundle and see how they have implemented it ;)

    Specifically, they have used sort -f for that command.

    In Xcode

    Xc4 doesn't offer external commands, but Xc3 did... what version are you using?

    Here's an overview for Xc3's script system: http://www.mactech.com/articles/mactech/Vol.23/23.01/2301XCode/index.html

    Xc4 allows you to run an external script via Behaviours, but you cannot pass or return text/selection.

    AppleScript

    You may be able to do it with AppleScript... every time I have tried to do anything nontrivial with AS + Xcode, it didn't work out very reliably (if at all). But that was with Xc3 - locating what you need may be easier with Xc4 (unified UI and all).

    I just use TextMate for this.

提交回复
热议问题