Panic

Panic Blog

From the desk of
Cabel
Engineering Dept.

EditorConfig for Coda 2.5

edcon_color_transbg2

EditorConfig is a clever idea: a simple text file you can put anywhere in your code source that automatically changes settings in your favorite text editor.

For example, let’s say someone decided one project had to use space indentation (for Python?) even though everybody usually uses tabs. With EditorConfig, you can easily declare this setting in an .editorconfig file in the root of the project…

  1. # top-most EditorConfig file
  2. root = true
  3.  
  4. # 4 space indentation
  5. [*]
  6. indent_style = space
  7. indent_size = 4

…or you could put this file in any folder in your project, and the editor will automatically pick it up. Then, you can easily check this file in to your source control system. Anyone who checks out your project — and uses a EditorConfig-capable editor — will automatically inherit the recommended editor settings.

We thought this was pretty cool, and so did our users, so we went ahead and built an EditorConfig plug-in for Coda 2.5. It currently supports everything except for the text encoding setting.


If that install link didn’t work, or you don’t want to install it right now, you can browse our plug-ins here.

When you’re ready, read up on the file format here. We hope you enjoy it!

Posted at 3:44 pm 12 Comments

Benji Greig

2/17/2015 7:01 PM

Bloody fantastic. Thank you lovely people of Panic. I’m now an equal citizen in my repos with my other programming brethren/sistren.

Mayte Eme

2/17/2015 7:32 PM

Brilliant!

It doesn’t seem to honor the `trim_trailing_whitespace = true` directive…

Bob Rockefeller

2/18/2015 5:49 AM

Very nice! This is a feature I’ve wanted in Coda for some time and it provides lots of flexibility for those writing in different “languages” that often want different indentation. I like Tabs:3 for PHP and Spaces:2 for YAML, for example.

Can this automatically convert four spaces to tabs when a file is opened?

@jules No it cant, it simply sets the editors current values.

@Ben Turns out I misunderstood what that directive was. :) I have added support for trimming white space, just update and you’ll be all set.

What’s new/updated in Plugin Version 1.0.1?

YAAAAAAAAY!!!

Benji Greig

3/15/2015 7:46 PM

Noticed that because of the way the plugin works it seems to mess with the undo history. Makes it very hard to step back after saving.

HOW DID I MISS THIS?

So glad I happened upon the blog today…

Is there a possibility of getting this to work with Sites? If not, is there a default local .editorconfig that is loaded when one is not found?