tags:

views:

32

answers:

1

I have started using Xcode as my main code editor. How might I make Xcode do things like using # instead of // for comments, and otherwise making the IDE friendlier?

+2  A: 

From what I can see it already gets the syntax highlighting right, so I think you're talking about the Cmd-/ script that comments a region out. If you select the Edit User Scripts option from the scripts menu you'll set that it's just a perl script. Find the line that tests the shebang in the file for what comment type and make it look for python too:

if ($fileString =~ m!^($perlCmt|$cCmt)?#\!\s*.*?/perl|^($perlCmt|$cCmt)?#\!\s*.*?/sh|^($perlCmt|$cCmt)?#\!\s*.*?/python!)

Note that you'll need to add the python shebang to files you want this to work with.

dcolish