“Sort Lines in Selection” for Xcode 4

前端 未结 5 1637
孤街浪徒
孤街浪徒 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:59

    You can do this with Automator:

    • Start Automator and select either:
      "Service" for macOS 10.7 or
      "New Document" followed by "Quick Action" for macOS 11
    • Find and drag "Run Shell Script" into the workflow panel
    • Select "Output replaces selected text"
    • Type sort -f into the "Run Shell Script" textfield
    • Save

    Now you can sort lines in any textfield. Select some text and right-click or Control click and select the service you just created.

提交回复
热议问题