File content type / formatting

Okay so, we all know that a .html file binds to the HTML format, the editor provides color highlighting, indentation for pressing enter and so forth, the same goes for .js files. However, let’s say we have a file with the extension of .uwu. Odd file extension you say? You’d be correct, but I don’t care, deal with it. The file has no formatting, no indentation, that’s fine I guess, but let’s they these are HTML template files, That’d be pretty annoying to write HTML in a file that has no care for it’s contents. Someone, possibily me would have trouble creating their beautiful (slight bias) website, wouldn’t they?

All foolishness aside, my problem is that I want to be able to declare a file content type. That’s it, nothing more nothing less, even if it’s a settings file with *.uwu=*.html for declaration that’d be absolutely lovely!

hey @RubyTheRose – can you clarify this idea further? It seems like a cool idea I’m just a bit confused. You want to be able to bind formatting rules for one file ending (.xml, .js) to an arbitrary file type ending? Maybe I’m missing something here, but I think that (at least with websites) this could cause parsing issues with the browser down the line

Hi RubyTheRose!

That’s a cool idea. Extensive customization of the editor and its behavior can lead to fragmentation of the community, when people can no longer read each others’s code or projects, which we definitely don’t want. However, for experts and hackers, CodeMirror is a global in the Glitch editor browser environment.

You could try something like CodeMirror.findModeByName('html').ext.push('uwu'); in the browser console, switch files in the file tree, and see whether that works for you?

Hope this helps,


1 Like

I agree with you on over complicating things, but a simple editor.conf file with settings would be a lovely addition, no need for complex UIs and such. That solution is fine as a brief solution, but for the long run, it’d be very tedious.

@Johnicholas That works for formatting, but the prettier isn’t there, what could I do to show it?