A possible solution to the `electricChars` issue would be to allow that property to contain a regexp, in which case the reindentation will only happen when the line (up to the newly typed text) matches the regexp. Does that sound like it'd work for you?