EditorConfig has been around for almost a decade at this point. It is widely supported by many editors natively and many more with plugins. You can find more information about their support editors on EditorConfig's site. My current configuration looks something like this.
I currently use a standard .editorconfig
on all of my projects and the only exceptions are Python and Markdown since I prefer an indent size of 2 but Python's community has standardized around 4 spaces. Markdown also has an odd way of adding line breaks by adding a space at the end of a line so I have to avoid stripping that extra whitespace.