foxfriends / syncat

Syntax aware cat
MIT License
53 stars 2 forks source link

Provide default setting #12

Closed Freed-Wu closed 1 year ago

Freed-Wu commented 1 year ago

nvim-treesitter use tree-sitter to parse file, too, which provide a default setting for many languages. Can this project provide default setting when user doesn't have ~/.config/syncat?

foxfriends commented 1 year ago

Released in 3.4.0:

When loading languages, if ~/.config/syncat/languages.toml does not exist, it will fall back to the default (syncat/config/languages.toml)

When loading stylesheets, if ~/.config/syncat/style/active/{lang}.syncat does not exist, it will fall back to the default (syncat/config/style/active{lang}.syncat). If that does not exist, then defaults to empty styles

Freed-Wu commented 1 year ago

https://github.com/foxfriends/syncat/blob/master/syncat/config/languages.toml only have ~50 languages. However, nvim-treesitter provides 134 languages. Is there any reason to not to provide extra languages such as cannot work?

foxfriends commented 1 year ago

There's no particular reason, feel free to make a PR adding more languages. The problem with just adding a language to the language.toml is that there will still be no highlighting until someone makes a stylesheet, which takes time and knowledge of the language, so I won't be adding many except for languages I use, otherwise they will be low quality highlights

Freed-Wu commented 1 year ago

The problem with just adding a language to the language.toml is that there will still be no highlighting until someone makes a stylesheet

I see. Is it possible to generate sytlesheet from https://github.com/nvim-treesitter/nvim-treesitter/tree/master/queries?

foxfriends commented 1 year ago

Hmm possibly, I'll take a look and see