At the moment I am developing a website and I need to edit lots files of the types .html, .js, .css and .pl. My preferred text-editor is Xcode (now in Version 5.1.1) running on an iMac (OS X 10.9.3). For this tasks I am NOT using Xcode as an IDE. I use it just as a text editor.

In the finder I right-click the file that I want to edit and select open with ▶︎ > Xcode to open it. When I do this for .html, .js and .pl Xcode automatically uses the correct kind of syntax coloring to highlight keywords, comments etc. in the source-code.

But when I open a .css file the same way then there is no highlighting automatically activated by Xcode. The complete text is written in black letters on white background. I can manually select Editor > Syntax Coloring ▶︎ > CSS in Xcode to get the correct highlighting. But I hate to do this 50 or 100 times a day when Xcode can do this for any other file type automatically.

I want Xcode to always automatically use the CSS-highlighting when it opens a .css file. How can this be done?

  • This appears to be a bug. In Standard file types.pbfilespec, there is an entry that says: <code> { Identifier = text.css; BasedOn = text; Extensions = (css); MIMETypes = ("text/css"); Language = "xcode.lang.css"; },</code> So it should be working properly, yet I am having the same issue.
    – Alex
    Jul 3, 2014 at 18:48
  • @Alex: Where can I find this file? I can't find it using spotlight. Jul 4, 2014 at 20:35
  • 1
    It is within the Xcode application package, so it is not indexed with spotlight. Available at: /Applications/Xcode.app/Contents/OtherFrameworks/DevToolsCore.framework/Versions/A/Resources/Standard file types.pbfilespec
    – Alex
    Jul 6, 2014 at 2:27


You must log in to answer this question.

Browse other questions tagged .