Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collection of Syntaxes Available #56

Closed
3 of 20 tasks
aatxe opened this issue May 4, 2018 · 5 comments
Closed
3 of 20 tasks

Collection of Syntaxes Available #56

aatxe opened this issue May 4, 2018 · 5 comments
Labels
question Further information is requested syntax-request

Comments

@aatxe
Copy link

aatxe commented May 4, 2018

I have a pasting service that also uses syntect, and I have a bit of a collection of syntaxes to potentially contribute. I believe many were converted from tmbundles using a ruby gem for this purpose, but they seem to work well enough in my experience. Some of these may already been included, and so I'll list them as a checklist.

  • Agda
  • Assembly x86
  • Befunge 93
  • Coq
  • CSS (Django)
  • F#
  • Handlebars
  • HTML (Django)
  • Idris
  • Isabelle
  • Lean
  • Less
  • Nearley
  • Nix
  • Pony
  • Prolog
  • Python (Django)
  • Racket
  • TOML
  • Vue

They're all available in an archive here.
(Sorry in advance, but I unfortunately didn't keep track of the source 😦)

@sharkdp
Copy link
Owner

sharkdp commented May 6, 2018

Thank you for the feedback!

Unfortunately, we will have to take performance considerations into account when adding lots of new syntax definitions, because (at least right now) the whole SyntaxSet is loaded into memory and deserialized on every run of bat.

Every user will still have the possibility to customize/extend his own syntax set, but I'm not sure we should "blindly" add all the syntax files we can get. When having to choose, I would probably go by popularity of the language (or the corresponding Sublime Text package).

Are there any languages from your list that you think should definitely be included?

@sharkdp sharkdp added question Further information is requested syntax-request labels May 6, 2018
@aatxe
Copy link
Author

aatxe commented May 6, 2018

TOML is a must-have, but I see in #37 you already added it. :)

Otherwise, my 0.02 would be Nix (since it's an increasingly popular package manager and definitely the kind of thing where I ordinarily use cat to check out a project config). I was also able to discern that the source for the Nix one is here and converted.

Vue also probably has substantial reach as a popular JS framework.

The rest (ignoring Django) are largely "exotic" languages, and so should perhaps be left out by default. I would personally benefit from the Coq one though.

@Porkepix
Copy link

Porkepix commented May 9, 2018

[First of all, sorry if that's not the right place to ask]

So, how/where are defined syntax languages for bat? Just discovered the project and saw that .ini files didn't have coloration. I tried to look a bit and quickly into this repository and syntect to see where is it and where should it be signaled, I'm still unsure though.

And maybe some could be loaded optionnaly if needed, to extend the number of managed language? (lazy load?)
Especially, this could be potentially be extended with tools later on, like something doing syntaxic coloration for logs for example.

@sharkdp
Copy link
Owner

sharkdp commented May 10, 2018

Otherwise, my 0.02 would be Nix (since it's an increasingly popular package manager and definitely the kind of thing where I ordinarily use cat to check out a project config). I was also able to discern that the source for the Nix one is here and converted.

I'd be okay with adding Nix, but I cannot find any .sublime-syntax files in that repo. I would like to avoid having to manually add syntax files somewhere, if possible.

So, how/where are defined syntax languages for bat?

Syntaxes are stored in the bat executable itself. They are loaded in there from this binary file which is, in turn, created by the assets/create.sh script.

Just discovered the project and saw that .ini files didn't have coloration. I tried to look a bit and quickly into this repository and syntect to see where is it and where should it be signaled, I'm still unsure though.

You can list all supported languages by calling

bat --list-languages

And maybe some could be loaded optionnaly if needed, to extend the number of managed language? (lazy load?)

Yes, this would be an option. However, loading .sublime-syntax files from disk and parsing them is quite costly and would significantly affect bat's speed. Have you seen the "Customization" chapter in the README?

@sharkdp
Copy link
Owner

sharkdp commented May 10, 2018

I am going to close this ticket. Please feel free to open dedicated tickets for single languages that should be added to bat, preferably with a link to a repository with a .sublime-syntax file and some example source code to test it.

@sharkdp sharkdp closed this as completed May 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested syntax-request
Projects
None yet
Development

No branches or pull requests

3 participants