Fork me on GitHub
#vim
<
2021-01-05
>
emilaasa09:01:41

I'm a long time nvim user and I'm looking at possibly moving from Cursive (IDEA plugin) to a vim based editing workflow, mostly for the editing speed and having a lighter environment. What's the state of the art now for using Clojure with vim? I write other languages with coc for completion and a language server, and that's pretty much it. I'm pretty into the sexp editing experience so I'd like that as well. EDIT: Perhaps this is a solution https://oli.me.uk/getting-started-with-clojure-neovim-and-conjure-in-minutes/

dharrigan09:01:14

I use Conjure, have done for nearly the very beginning. It's a great tool. I also use it with clojure-lsp and CoC

dharrigan09:01:28

All works wonderfully

dharrigan09:01:42

There is the #conjure channel if you need more support.

emilaasa09:01:34

Actually I think that's the emotional support I was looking for 😃

dharrigan09:01:01

You'll find plenty of TLC here and in #conjure 🙂

Olical09:01:58

That post is from me, so AMA if you have questions 😄

emilaasa09:01:55

Neat! One question is around autocomplete - is that provided with Conjure as well?

Olical09:01:31

So it supports vim's built in "omnicomplete", which isn't reaaaaly autocompletion since omnicompletion locks up the editor while it does it's thing. It does however have built in support for https://github.com/Shougo/deoplete.nvim, so if you have that installed you get fully asynchronous autocompletion right away! There's also plugins that connect Conjure to things like CoC and a few other neovim specific completion libraries.

Olical09:01:26

But yeah, omnicomplete is fully supported and there's support for various autocompletion plugins, including built in deoplete support (since it's the one I use so I support that one directly)

emilaasa09:01:20

Ah, I've used CoC for a while and think that works well as the "frontend" for completion, I'm curious about what "backend" to use, Conjure or the LSP.

Olical09:01:56

I don't use it, but I think it works well!

Olical09:01:21

And yeah, full LSP based tooling works great too, I only rely on Conjure and my REPL but I know it works great for some.

emilaasa09:01:49

Seems cool, I'll just give both a try and see what happens 😃

emilaasa09:01:46

One other curious george question, can I control the printing from the REPL? I often want to append output to a source file while experimenting or writing a rich comment block

emilaasa09:01:20

(+ 1 1) ; 2

dharrigan09:01:09

I use coc-conjure

dharrigan09:01:46

That request, to append the output of the eval to the form, is under consideration by Oliver 🙂

dharrigan09:01:55

It was talked about a bit before the holidays

dharrigan09:01:15

It does output the results of the eval as virtual text beside the form, but nothing yet to make it into a comment.

dharrigan09:01:36

I think Oliver can pitch in more about his thoughts around this (I think it was a matter of determining demand?)

Olical10:01:07

Now you're providing more evidence of people wanting this feature (I didn't personally), so I'm getting gradually more convinced 😅 I mostly have the ability to do this, the framework is there. There's also <prefix>e! if you want to replace the code with the result. Every result is also placed in the c register by default I think? So you can do <prefix>eeA ; <c-r>c<esc> for now potentially.

dharrigan10:01:26

(I would like that feature too.... 🙂 )

Olical10:01:39

I configured my Conjure to place all results in my " register for speed

Olical10:01:28

Yep, I think it's gotta happen at some point 😅 if someone would like to raise an issue so I don't forget (and add comments / emoji to share ideas and support of the idea) that'd be amazing

emilaasa10:01:53

It's super effective for screencasts and saving output in comment blocks

dharrigan10:01:07

I'll add an issue

emilaasa10:01:20

but if it's already in a register I'm fine with that too 😃

emilaasa10:01:42

<c-r>c then?

Olical10:01:09

Yep, it should be c by default. It's in the :help conjure somewhere too. I think the "add the result as a comment" feature is a good idea though.

emilaasa10:01:34

Yeah, possibly as repl "mode" or something, it can be quite effectful

Olical10:01:44

Would it not be under a different mapping? Say, <prefix>ec to evaluate the current form and append the result as a comment? Or were you thinking a setting you flip on that appends all results no matter what action you took?

emilaasa10:01:39

Ah yeah I guess that wouldnt matter as much for me, probably a separate mapping is good/better

dharrigan10:01:43

I would support having a differnet mapping

Timofey Sitnikov16:01:28

I wonder how conjur and vim-iced compare, I have been using vim-iced has anyone used both and found one to be better than another?

enforser17:01:54

seems that most people have moved to conjure or vim-iced, eh? Been a bit since I worked heavily in clojure but vim-fireplace always had everything I felt I needed - is it considered archaic now?

dave17:01:34

^i'm not sure how we could definitively answer that, unless maybe github provides metrics for repo clones

dave17:01:38

i have seen more and more people talking about alternatives to fireplace over the last few years my assumption (based on no evidence whatsoever 🙂 ) is that fireplace is probably still the most popular plugin for clojure development in vim, simply because it's been around for so much longer

dave17:01:29

up until about a year or so ago, i would have recommended that a newcomer who wants to do clojure dev in vim should use fireplace because it's more mature/stable, but at a certain point, conjure became stable enough that it's what i would recommend nowadays

dave17:01:41

to be fair, it was quite stable even in the early days 😄

dave17:01:23

fireplace is still actively maintained, so i wouldn't call it archaic

dave17:01:41

i think conjure and iced give you a lot more features

juhoteperi17:01:19

Biggest benefit in Vim-iced is async evaluation. Like if you run tests on namespace that takes 15 seconds, it won't block Vim.

dave17:01:41

^that's exactly why i began to explore fireplace alternatives!

juhoteperi17:01:06

Though I see that Fireplace 2.0 mentions running tests async, but I think it still doesn't run normal cpp etc. async.

dave17:01:15

i've tried both iced and conjure. ended up loving conjure. iced was also great, i think i was just trying it early on and it couldn't quite do all the things i wanted it to do at that time

dave17:01:45

i expect that iced has improved substantially over the past few years. i keep hearing great things about it

Jan K17:01:55

With latest vim-fireplace you can push long-running evaluation into background with ctrl+d, making it finish asynchronously

💯 3
Timofey Sitnikov17:01:51

I am embarrassed 😁 to say this, but the reason I did not choose fireplace is I could not figure out how to install and use it. I found vim-iced documentation super easy to follow. It seems to do everything except lint so I use clj-kondo via https://github.com/iamcco/coc-diagnostic Maybe one day I will try conjure ...

3
dave18:01:23

what exactly does this plugin do? :thinking_face: is it a replacement for ALE? is it just making it so that you can see multiple linter warnings/errors at once, instead of just one?

Timofey Sitnikov18:01:16

coc-diagnostic a plugin for COC, https://github.com/neoclide/coc.nvim. Yes it can aggregate from multiple linters, but I just use the clj kondo. Coc is an amazing tool for C/C++, thats what I have done professionally. I am not sure that it provides any advantages in clojure.

dave19:01:03

i use COC too, it's great! i have it set up to use clojure-lsp, and it's amazing

Timofey Sitnikov19:01:18

Yeh, but it looks like it overlaps with vim-iced.

Timofey Sitnikov19:01:49

vim-iced does pretty much everything clojure lsp plugin.

borkdude18:01:43

@timofey.sitnikov That's surprising since I've seen the author of vim-iced use clj-kondo specifically for analysis

juhoteperi18:01:19

No reason to implement linting in vim-iced as there are lots of existing linting plugins

Timofey Sitnikov18:01:32

OK, so yes looks like the author of vim-iced uses clj-kondo via ale, I just use it via coc-diagnostic.

juhoteperi18:01:32

Ah and yes, Iced can use kondo analysis data for some operations: https://liquidz.github.io/vim-iced/#static_analysis_clj_kondo