This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-12
Channels
- # aleph (3)
- # announcements (15)
- # architecture (6)
- # babashka (35)
- # babashka-sci-dev (10)
- # biff (5)
- # calva (9)
- # cherry (1)
- # cider (44)
- # clj-kondo (31)
- # cljfx (1)
- # clojure (108)
- # clojure-europe (32)
- # clojure-norway (12)
- # clojurescript (15)
- # conjure (3)
- # cursive (8)
- # datahike (1)
- # datalevin (19)
- # datascript (1)
- # datomic (59)
- # emacs (4)
- # graphql (3)
- # jobs (1)
- # luminus (6)
- # meander (9)
- # membrane (45)
- # nbb (67)
- # off-topic (16)
- # portal (3)
- # remote-jobs (1)
- # scittle (8)
- # shadow-cljs (46)
- # test-check (7)
- # tools-deps (5)
- # vim (63)
- # web-security (11)
- # xtdb (15)
I've been using vim-iced, but now I just started trying out Conjure. Seems very nice, but I'm still finding my way. Going through the internal docs for conjure and conjure-client-clojure-nrepl, and scrolling through the output for :map
, I don't see a mapping or function that means "evaluate the largest sexp containing the cursor that is not (comment ....)
", like https://liquidz.github.io/vim-iced/vim-iced.html#%3AIcedEvalOuterTopList. Conjure comes with <leader>er
for EvaluateRootForm
, but that returns the result of (comment ...)
, i.e. nil
. Am I missing something? I wouldn't think that I'd have to write a little script myself, since evaluating what's at a "top" level within a comment seems like it would be a common practice.
You can now <LocalLeader>er
inside Rich comments with Conjure: https://github.com/walterl/conjure-efroot 😬
OK! Thank you @clojurians-slack100
Ha! I was just doing a shameless plug. I didn't even realize I was responding to a question asked only minutes ago 😅
E5108: Error executing lua [string ":lua"]:1: module 'conjure-efroot' not found:
no field package.preload['conjure-efroot']
no file './conjure-efroot.lua'
no file '/usr/local/Cellar/luajit-openresty/2.1-20220411/share/luajit-2.
1.0-beta3/conjure-efroot.lua'
no file '/usr/local/share/lua/5.1/conjure-efroot.lua'
no file '/usr/local/share/lua/5.1/conjure-efroot/init.lua'
no file '/usr/local/Cellar/luajit-openresty/2.1-20220411/share/lua/5.1/c
onjure-efroot.lua'
no file '/usr/local/Cellar/luajit-openresty/2.1-20220411/share/lua/5.1/c
onjure-efroot/init.lua'
no file './conjure-efroot.so'
no file '/usr/local/lib/lua/5.1/conjure-efroot.so'
no file '/usr/local/Cellar/luajit-openresty/2.1-20220411/lib/lua/5.1/con
jure-efroot.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
[C]: in function 'require'
[string ":lua"]:1: in main chunk
conjure should also be able to do this natively with treesitter too: https://github.com/Olical/conjure/releases/tag/v4.37.0
I have not touched treesitter. I am not even clear on what it is. One thing at a time!
essentially its a way for neovim to understand the syntax of the code and can be used for various things like semantic highlighting, refactoring, etc https://www.reddit.com/r/neovim/comments/jr7gbz/what_is_neovim_tree_sitter/
it tries to understand the code youre writing in a similar way a compiler would do
so if you have it enabled, conjure can use the syntax info to do its magic
you can check out https://github.com/lispyclouds/dotfiles if it helps, quite minutely configured and very clojure biased 😄
From the link you posted, it looks like just installing treesitter will remap <LocalLeader>er
to ignore the top-level comment, even if I don't use treesitter in any other way.
if you wanna get into extreme details of treesitter: https://www.youtube.com/watch?v=Jes3bD6P0To From the people who made it (Atom team in GitHub)
OK, cool. Excellent. So I have two solutions. I might prefer efroot, on the theory that adding more stuff means that there's more to be confused about if something goes wrong. I'll look at your dotfiles, though, and see whether there are other reasons that I'll want to use treesitter. There are a lot of cool editing tools that aren't as useful for me as for other people because I won't use them as often.
Thanks @rahul080327.
it generally enables a whole new set of things, stuff you thought you didnt need 😛
Yeah .... I am sure it will. I don't code constantly--it's only part of my work (a fun part)--so sometimes it's easier to use a few more keystrokes so that I don't have to remember a convenient trick that I could use instead. If was coding all the time, I'd use the trick often enough that I'd remember it, and it would be more valuable.
fair points!
Tree-sitter is definitely the future. The only reason I disabled it again is that it breaks indentation in Clojure.
Specifically, when you have curly braces in strings, it apparently tries to align them as if it's the JavaScript source I'm generating 😛
interesting @clojurians-slack100 i would suspect that to be happening from a structural editing plugin not tree sitter :thinking_face:
hmm i never seem to have run into that issue, do you have an example maybe and your config?
It would be (more) interesting if it's due to my config (https://github.com/walterl/dotfiles)
seems okay for me, im using rust-parinfer with it
yeah not sure if anything in your vimrc could trip it, will try running it properly in sometime
ah didnt see the _config/nvim, will see that too
theres indentation settings in clojure.vim too, with conjure and tresitter i dont need that anymore. maybe that could be something?
That's what I'm looking at too (I see indentexpr=GetClojureIndent()
, which comes from clojure.vim), but for some reason disabling clojure.vim isn't "taking" 😕
I confirmed that clojure.vim is not in my runtimepath, but GetClojureIndent
still exists
could come from a lot of places, try loading nvim without any config?
i'll try to have a better look later but have a strong feeling its a combination of things that's tripping it, not just treesitter
you could try my dotfiles too, quite less elaborate than your setup, see if the issue is still there?
same as yours GetClojureIndent()
yeah i guess its built in
not sure what its for but looks interesting: https://github.com/walterl/dotfiles/blob/master/_config/nvim/after/queries/clojure/highlights.scm
Interesting. TSModuleInfo
reports only highlighting is supported:
>> default highlight incremental_selection indent
astro ✗ ✗ ✗
bash ✗ ✗ ✗
beancount ✗ ✗ ✗
bibtex ✗ ✗ ✗
c ✓ ✗ ✓
c_sharp ✗ ✗ ✗
clojure ✓ ✗ ✗
yeah thats my expectation too, hence was thinking it could be a structural editing thing issue. clojure ts grammar is quite simple
Thanks @rahul080327.