It was actually surprisingly simple to implement using the libraries the [EditorConfig] project provides. Komodo’s backend is largely Python based so all I had to do is include their Python library and expose it to our editor component.
[EditorConfig] in Komodo actually comes with a nice little extra; you can use Komodo preferences too! Meaning any simple string, boolean or integer preference that Komodo uses can be defined in your .editorconfig file. For example:
root = true
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
; Komodo Settings
editAutoWrapColumn = 140 ; Edge line column at 140 characters
editWrapType = 1 ; Wrap by word
trackchanges_enabled = false
Notice the little section at the bottom there? Now keep in mind that these preferences were never intended to be exposed this way, so finding out what preferences you can use and how they work can take a little digging ([DOM inspector] to the rescue), but it makes for some interesting use-cases.
Keep in mind that this extra functionality is very experimental. If you mess up your Komodo install you can easily reset file level preferences by deleting your [doc-sate.xmlc][doc-state] file from your profile folder (while Komodo is not running).