vim

For discussion on all things (neo)vim.
fedreg 2021-05-26T17:14:49.026400Z

Anyone using Neovim with Treesitter? Doesn't seem to work correctly for me... the def/defn and name have the same color and the rainbow parens (I use junegunn/rainbow_parentheses.vim) are not showing. Installation seemed simple enough but maybe I'm missing something? Just have

lua <<EOF
  require'nvim-treesitter.configs'.setup {
    highlight = {
      enable = true,
    },
}
EOF
and the clojure grammar installed. Neovim nightly (pics show without / with treesitter enabled). Thx for any help!

Aleh Atsman 2021-05-28T13:40:35.033500Z

clojure syntax grammar in tree sitter is poor

Aleh Atsman 2021-05-28T13:40:42.033700Z

it is the same for me

Aleh Atsman 2021-05-28T13:40:55.033900Z

there are no distinctions for def defn

Aleh Atsman 2021-05-28T13:41:07.034100Z

it treats it just as a list with items

Aleh Atsman 2021-05-28T13:41:19.034300Z

that's why it shows it one color

Aleh Atsman 2021-05-28T13:42:50.034500Z

here is the file https://github.com/sogaiu/tree-sitter-clojure/blob/master/grammar.js

2021-05-29T18:47:10.035100Z

Yup, I was confused by that as well. Checked with treesitter playground

emilaasa 2021-05-26T19:26:48.027700Z

There's probably no color scheme made for clojure yet I'd guess?

emilaasa 2021-05-26T19:34:43.029400Z

Hm maybe you need to use one of these schemes: https://github.com/nvim-treesitter/nvim-treesitter/wiki/Colorschemes

emilaasa 2021-05-26T19:34:48.029600Z

Not sure how that stuff works 🙂

fedreg 2021-05-26T20:09:28.032200Z

I was thinking the same thing.. but there was a AMA on Reddit by one of the Tree-Sitter devs a couple days ago.. https://www.reddit.com/r/neovim/comments/nk2mk0/ama_treesitter_integration_in_neovim/ and I thought he said that any colorscheme should work.. 🤷 I'll try one of the ones in the wiki (thx!) and see what happens. Not a big deal really.. was just curious what kind of difference the tree sitter would make for highlighting.

emilaasa 2021-05-27T07:25:36.032500Z

I tried a fennel file and that looked more interestingly syntax highlighted