Codeigniter Syntax Mode for Coda 2

If you’re a Coda user who writes a lot of Codeigniter projects like me, you were probably using this Codeigniter syntax mode in your Coda 1 (submitted by author nextgengames under User contributed modes of SubEthaEdit)

And if you upgraded to Coda 2, then imported the syntax mode, you were probably surprised to see that autocompleting features of the syntax mode were working as they used to, but the syntax coloring was gone.

Because in Coda 1, the syntax colorings were related to “Languages”.

Coda 1 syntax coloring related to languages

Coda 1 syntax colorings were related to languages

 

In Coda 2, Panic decided to make it more flexible (as in many other features).

Coda 2 syntax coloring preferences

Coda 2 syntax coloring preferences

 

The Codeigniter syntax mode written for Coda 1 needs a tiny little update to work with Coda 2 as expected. What you got to do is very easy, still if you’re lazy enough skip the steps and download the file at the end of this post.

  1. Go to your Coda 2.app file (probably under your /Applications folder), CTRL+click on it and select Show Package Contents
  2. Under Coda 2.app package, find Contents/Resources/PHP-HTML.mode, CTRL+click on it and select Show Package Contents
  3. Under PHP-HTML.mode package, go to Contents/Resources and leave this folder open (we’re going to need in a minute)
  4. Go to ~/Library/Application Support/Coda 2/Modes/ (I’m supposing you already copied the CI syntax mode file here) and CTRL+click on Codeigniter.mode and select Show Package Contents
  5. Under Codeigniter.mode package, go to Contents/Resources
  6. Copy the following 2 files
    from “PHP-HTML.mode/Contents/Resources”
    to “Codeigniter.mode/Contents/Resources”

    • CodaClipDefaults.plist
    • SyntaxDefinition.xml
  7. A version of SyntaxDefinition.xml is already there, overwrite it (or back up a version first, it’s up to you)
  8. Open these newly copied 2 files in a text editor and do a find/replace operation to change every “PHP-HTML” text to “Codeigniter”

And you’re done. Now in Coda 2, when you change the Syntax Mode to Codeigniter, both the autocompleting and the syntax coloring will work as they used to in Coda 1.

 

Download

Download Codeigniter Syntax Mode for Coda 2

(updated for Coda 2.0.2)

11 thoughts on “Codeigniter Syntax Mode for Coda 2

  1. Hello,

    Thanks for the post. I’ve followed the steps multiple of times and I still can’t get the variables ‘auto-completion’ to work. Any help?

  2. What happens if I don’t have this folder
    ~/Library/Application Support/Coda 2/Modes/
    My Coda Version is 2.0.13

  3. Thx! Works like a charm! A note that tripped me up… Restart the coda 2 after you made changes to those files. You should then open your project and from Menu Bar select Text>>Syntax Mode>>Codeigniter in order to get the autocomplete feature working.

  4. The Coda Syntax Mode plugin seems to crash CodaIndexer in Coda 2.5 by triggering indexing have files have been added to the site’s file tree. I’ve been experiencing this problem for weeks now, and the nice folks at Panic have narrowed the problem down to your CodeIgniter plugin.

    Here’s a snippet from the crash log:

    Application Specific Information:
    *** Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘BUG: Mode state not found: ‘/Codeigniter/Inline JavaScript”
    abort() called
    terminating with uncaught exception of type NSException

Leave a Reply

Your email address will not be published. Required fields are marked *