.editorconfig

Purpose:

Standardise code formatting across different editors

The file

Installation

Visual Studio

WebStorm
Sublime
Atom

Visual Studio

https://visualstudiogallery.msdn.microsoft.com/c8bccfe2-650c-4b42-bc5c-845e21f96328

WebStorm

https://github.com/JetBrains/intellij-community/tree/master/plugins/editorconfig

Sublime

https://github.com/sindresorhus/editorconfig-sublime

Atom

https://github.com/sindresorhus/atom-editorconfig

Atom Shell Commands

Open Atom and go Atom > Install Shell Commands you will get apm commands.

Atom Shell Commands

Then run 'apm install editorconfig' in terminal

Create a local file

Open the editor command line

and type 'editorConfig: Generate Config'

How does it work

It looks for a file in every directory starting at the current one going upwards to the root

and uses this to control the editor

 

As a line-by-line file it can be easily version controlled

Gotchas

Other packages might override the settings so turn off any package settings that relate to

  • indent_style
  • indent_size
  • tab_width
  • charset
  • trim_trailing_whitespace

 

Gotchas

Core settings like Soft/Hard Tabs may override it

Conclusion

Though its influence is limited it does mean we can enforce some consistency between developers and editors on a project by project basis

Made with Slides.com