Take the tour ×

I've got Xcode 3.2.1, and enjoy using it, but when I'm editing a file with hyperlinks in the text (for example, a comment with a reference: # see http://example.com) Xcode turns the text into a clickable hyperlink. This is a royal PITA when trying to edit that hyperlink, as it means I can't click inside it to edit a piece of the link -- I have to select it all and retype, or backspace/arrow-key eleventy-bajillion times to get to the part that needs changing.

Anyone know how to turn that off? I don't see it anywhere in the preferences, and have Googled until my fingers fell off, to no avail.

share|improve this question
add comment

2 Answers

Use the option key when selecting text in the link or more drastically, turn off syntax highlighting for the file.

share|improve this answer
Any idea where Xcode stores the syntax highlighting rules? I wonder if there's an editable resources file somewhere. –  Zee Jan 2 '10 at 18:22
add comment
up vote 2 down vote accepted

Dug a little further, and I found that Xcode 3.x hides its syntax highlighting rules in xclangspec files, so editing the appropriate file will allow you to change the rules to an extent.

Files are stored here:


In that directory, I opened BaseSupport.xclangspec and found the line that identified the URL protocol:

    Syntax = { 
        StartChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";           
        Chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789;/:@&=+$,-_.!~*'()%#";
        Match =
        ); */
        Type = "xcode.syntax.url";

and changed the line for Match = to read:

Match = ();

This eliminated URL matching, but not mailto matching (which is in a separate rule below the first). I'm leaving that as an exercise for the reader ;-)

Obviously, I could have been more selective, and I suspect that changing the Type line would be sufficient as well. Also, future versions of Xcode will likely overwrite this change, so I'll have to investigate putting the change into my own copy of BaseSupport.xclangspec and see if sticking it in ~/Library/Application Support works.

share|improve this answer
add comment

Your Answer


