This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-28
Channels
- # announcements (2)
- # aws (21)
- # babashka (4)
- # babashka-sci-dev (17)
- # beginners (3)
- # cider (16)
- # clj-kondo (61)
- # clojure (122)
- # clojure-europe (11)
- # clojure-spec (3)
- # clojurescript (2)
- # conjure (19)
- # helix (9)
- # hyperfiddle (2)
- # inf-clojure (18)
- # lsp (12)
- # off-topic (15)
- # react (2)
- # releases (1)
- # shadow-cljs (40)
- # spacemacs (4)
- # tools-deps (5)
- # vim (15)
Hey. Who uses treesitter, do you have a problem that braces inside strings take effect on parsing? https://github.com/nvim-treesitter/nvim-treesitter/issues/2966
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: https://clojurians.slack.com/archives/C0DF8R51A/p1652287464353689
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 https://clojurians.slack.com/archives/C0DF8R51A/p1638774405114700 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.
Can confirm the fix suggested in https://github.com/nvim-treesitter/nvim-treesitter/issues/2966#issuecomment-1140408607 does work on all the related problems. Other nvim-treesitter issues suggest using a TS-aware matching plugin like https://github.com/andymass/vim-matchup, 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.
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
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: https://clojurians.slack.com/archives/C0DF8R51A/p1647395546702489?thread_ts=1647377862.618059&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?
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? https://github.com/Olical/conjure/tree/master/fnl/conjure