tree-sitter-nu icon indicating copy to clipboard operation
tree-sitter-nu copied to clipboard

Syntax Highlighting

Open jgollenz opened this issue 3 years ago • 7 comments

Do you have any plans for syntax highlighting in this repo? It appears common that treesitter repos (I sampled cpp, js and python) do have highlights.scm files. My general experience so far was that syntax highlighting starts working once I install the parser with TSInstall.

I started looking into it and if you don't mind, I'd like to give it a try :)

jgollenz avatar Dec 09 '22 12:12 jgollenz

I was planning on it but wanted to finish the syntax first. I'm fine with any positive contribution at any time.

fdncred avatar Dec 09 '22 12:12 fdncred

I see. I'm new to tree-sitter in general, so it doesn't really matter what I work on, it will be trial-and-error either way.

May I ask what your workflow is? So far I managed to get the parser working by itself and add it to neovim where I can inspect it in ts-playground (although it is not updating when the buffer changes). However, the syntax highlighting module is not enabled and I don't know how I can do so. Running tree-sitter highlight some-file.nu works fine, but no highlighting inside neovim.

jgollenz avatar Dec 09 '22 15:12 jgollenz

My workflow is maybe less than that. I just do what I put in the read me. For inspiration, you can see how the helix editor shows the syntax highlighting. Someone contributed the scm files a few months ago.

fdncred avatar Dec 09 '22 18:12 fdncred

see how the helix editor shows the syntax highlighting

could you please drop me a link to it? :)

jgollenz avatar Dec 09 '22 18:12 jgollenz

no problem https://github.com/helix-editor/helix/tree/master/runtime/queries/nu

fdncred avatar Dec 09 '22 22:12 fdncred

Can this be closed? TSInstall nu enables highlighting

Feel-ix-343 avatar Jan 16 '24 22:01 Feel-ix-343

The syntax highlighting is minimal and can be made better via queries.

fdncred avatar Jan 17 '24 13:01 fdncred

I believe that this issue can be closed. There are only specific issues that need to be specifically addressed.

mrdgo avatar Sep 17 '24 14:09 mrdgo