Fork me on GitHub

Hey. Who uses treesitter, do you have a problem that braces inside strings take effect on parsing?


Yep! I get this in fennel and clojure a lot, it's really annoying 😞


TS is better in every way except this, it's almost a total deal breaker. I have to disable TS for some buffers because of it.


I think it's related to the issue I reported a few weeks ago: It looks like the TS highlight has a few bugs when dealing with Clojure. The TS highlight module also breaks string handling in vim-sexp. I think this old was reporting the same thing. Basically, the operator-pending string mappings defined in vim-sexp (`as`, is) stop working completely after :TSEnable highlight and :TSDisable highlight fixes it all.

🙏 1

Can confirm the fix suggested in does work on all the related problems. Other nvim-treesitter issues suggest using a TS-aware matching plugin like, but that alone doesn't fix this issue. Thanks for raising this @UL05W6AEM. Not sure, but maybe setting additional_vim_regex_highlighting = "clojure" should be suggested in plugins that rely on it, like vim-sexp.

Leaf Garland23:05:03

I've been using this plugin for a little while - it seems to work ok.


If I get it correct, it will support % and delete-matching-pair. But indents wont work and sexp vaf will not work either

Leaf Garland11:05:21

True. vim-sexp is using the old syntax highlighting to know what text is strings or comments - so it won't work correctly with treesitter.


I think this is what I was picking up on what I thought a while back that treesitter conflicts with LSP:;cid=C0DF8R51A So it's not LSP that's the issue, it's the very popular vim-sexp that doesn't work correctly with treesitter. And vim-sexp is used by vim-iced, so the conflicts run deep there. It's quite difficult to understand all this. I'm starting to make sense of it now, but I can see how this would be frustrating for someone new to Clojure and trying to configure their Vim as their editing environment. Perhaps I'll open an issue in vim-sexp to highlight the potential issues with treesitter. Is there anything else we could do to improve/clarify the situation for people trying to set up/modify their Vim for Clojure?

👍 1

If only there is a decent alternative to vim-sexp. May be it could be built in inside Conjure? Then Counjure would become the only needed plugin for neovim (with lsp and treesitter).


I don't totally understand the differences between them - haven't really tried Conjure at length - but I love vim-iced. I would hope some improvement to the landscape could be leveraged by whatever development environment people prefer. Both vim-iced and Conjure are actively maintained, and I'm not sure how vim-fireplace fits into the picture, if it does, or if there are yet more alternatives.


I used to be iced-user. Compare to it conjure seems to be much faster (one reason is that vim-iced is written with vimscript, and conjure with lua). One more advantage of conjure is that is supports fennel, so one can write vim-config with almost the same workflow as with clojure.


@UL05W6AEM do you know if you can also use fennel to extend Conjure?


What do you mean by extend? Write your configs in fennel and use some conjure mappings? Or do you ask weather Conjure itself is written in fennel?