zyedidia / micro

A modern and intuitive terminal-based text editor
https://micro-editor.github.io
MIT License
24.41k stars 1.16k forks source link

Typst syntax #2780

Open ghost opened 1 year ago

ghost commented 1 year ago

Description of the problem or steps to reproduce

I think it would be help to add Typst syntax:

https://github.com/zyedidia/micro/tree/master/runtime/syntax

maybe not the full language, but at least the basics:

https://typst.app/docs/reference/syntax https://github.com/typst/typst

KronosTheLate commented 9 months ago

Big +1 on adding typst syntax highlighting. To me, typst feels like a word and latex killer, and is rapidly growing and developing. Support would be lovely!

dei-layborer commented 7 months ago

I'm hoping to implement just such a thing. It doesn't seem like we can have our own "plug in" syntax highlighting files (the way we can with e.g. color schemes), so I presumably will have to create a pull request to have it merged into the main codebase, unfortunately.

dmaluka commented 7 months ago

It doesn't seem like we can have our own "plug in" syntax highlighting files (the way we can with e.g. color schemes)

I think we actually can. You can put your own syntax .yaml or .hdr files to ~/.config/micro/syntax directory.

Also if you want to do it via a plugin, you should be able to do it via something like this in your plugin:

config.AddRuntimeFile("typst", config.RTSyntax, "typst.yaml")

That said, although the above should work, why not add it to the main micro codebase instead? FWIW it's the first time I hear about typst, but if it's useful, why not have its syntax support available out of the box?