Fix WordPress Syntax Mode for Coda 2

NOTE: Apparently my version no longer works for Coda > 2.0.2. Try the newer versions made available by Matthew and deryckoe. Thanks guys!

If you’ve updated to Coda 2 and have been using the excellent WordPress Syntax Mode by Thorsten, you need to copy it (and any other modes you’ve been using) over to ~/Library/Application Support/Coda 2/Modes/. It works just fine, but syntax highlighting is broken. To fix this (and avoid wading through too much code), I simply made a copy of the SyntaxDefinition.xml file in /Applications/Coda 2.app/Contents/Resources/PHP-HTML.mode/Contents/Resources/ and copied over the contents of the <keywords id="PHP4 Functions"> ... </keywords> node from Thorsten’s version.

Finally replace all instances of PHP-HTML in the file with PHP-HTML-WP, save the file as SyntaxDefinition.xml in ~/Library/Application Support/Coda 2/Modes/PHP-HTML-WP.mode/Contents/Resources (replacing the old one) and restart Coda 2.

For convenience, here’s the whole updated mode package: PHP-HTML-WP.mode. Unzip and drop into ~/Library/Application Support/Coda 2/Modes/.

NB: This is just a quick hack until Thorsten updates the original. I cannot guarantee this will work perfectly for everyone.

Screenshot of Coda 2

38 thoughts on “Fix WordPress Syntax Mode for Coda 2

  1. Hi guys,
    I just switched to Coda v2 (from DW) yesterday – and I would so love to get the WP syntax into coda BUT … There is no folder under my application support called Coda – and naturally adding it, does not hep.
    Could anyone be so kind to tell me how I do this?

    1. Just a follow up there does seem to be a performance hit when using this. I get a fair bit of lack when typing using this syntax mode compared to the standard PHP-HTML

    1. Oh shh.. I’m still on 2.0.1 (MAS version). Has anyone else the same issue ? I won’t upgrade if so..

  2. Thanks for the comments guys! Since I haven’t been actively using Coda 2 for a while, I’ve updated the post to point to the new versions by Matthew and Deryck.

    1. A lot of developers are using Sublime Text 2 and it’s a good one but I don’t like the look and feel of the App. That’s the truth, at least for me. I feel very “unfinished” in this aspect. Panic Coda 2 have some performance issues but I think it’s one of the best right now.

Leave a Reply