Create custom syntax highlighting for all file extensions

Recently, I’ve been working on a project involving “custom” file extensions. As most of you know, on Replit, when creating a file with a file extension that doesn’t already exist, it will be created as a .txt file, or in other words, a file containing plain text. Since I’m trying to create a new language, I find it incredibly irritating that the text in my file is always white. There’s currently no built-in way to change this, and I think that there should be.

For example, the extension .py and .html both get their own syntax highlights. However, if you copied the contents of a .py file to a .txt file, the code inside the .py file would have syntax highlights, whereas the .txt file would become white and colorless without syntax highlights. If you put in your own format, for example, .myl, it would be the same as the .txt file - white and colorless.
I’m that saying you should be able to take the syntax highlighting from that .py file I mentioned before, and apply it to the .txt and .myl files. In addition to what I just mentioned, you should be able to customize the syntax highlighting like you can with themes, except the it would be specific to each file type.


Welcome catbox305 to the forum
I also think this should be a feature

for now, if the python syntax highlighting works for your language, you could make it use a extension instead, or you could edit your .myl file on replit through a .py symlink. For example, run in shell:

ln -s coolfile.myl
1 Like

The problem I have is that my language uses its own syntax, and is interpreted with python. So, I can’t symlink it (I’ll just assume that symlink means to “disguise” the file as another extension, feel free to correct me if I’m wrong) because it’s not a python file, and isn’t meant to be.

(btw for context .myl shown above is standing for “my language”, the actual project uses .mud, .stmud, and .bmud. I can put a link to the project if you’d like.)


if you have custom syntax for their language, you can write a Codemirror 6 mode and email—here’s a template


How exactly do I use that template?

Can we get this language template to work directly from an LSP?

I feel like this is pretty low hanging fruit, opposed to having to manually build out these template, when LSPs for various languages already exist.


This needs to be added. As a developer for the Aardvark programming language, which is now a LLVM compiler written in Aardvark for Aardvark, it is very difficult to build large projects such as this compiler on replit without syntax highlighting or autocomplete.


I would love to be able to use .tmLanguage files. Replit is pretty awesome for esolangs, so it would be great to be able to actually use syntax highlighting!