Xcode source automatic formatting

后端 未结 19 634
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-29 16:10

As a C# developer, I have become highly dependent on the automatic formatting in Visual Studio 2008. Specifically, I will use the CTRL + K , D

19条回答
  •  执笔经年
    2020-11-29 16:28

    My personal fav PrettyC wantabe is uncrustify: http://uncrustify.sourceforge.net/. It's got a few billion options however so I also suggest you download UniversalIndentGUI_macx, (also on sourceforge) a GUI someone wrote to help set the options the way you like them.

    You can then add this custom user script to uncrustify the selected text:

    #! /bin/sh
    #
    # uncrustify!
    echo -n "%%%{PBXSelection}%%%"
    /usr/local/bin/uncrustify -q -c /usr/local/share/uncrustify/geo_uncrustify.cfg -l oc+ <&0
    echo -n "%%%{PBXSelection}%%%"
    

提交回复
热议问题