vim

For discussion on all things (neo)vim.
emilaasa 2021-01-05T09:23:41.288500Z

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/

dharrigan 2021-01-05T09:31:14.289400Z

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

dharrigan 2021-01-05T09:31:28.289700Z

All works wonderfully

dharrigan 2021-01-05T09:31:42.290Z

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

emilaasa 2021-01-05T09:39:34.290700Z

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

dharrigan 2021-01-05T09:41:01.291200Z

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

Olical 2021-01-05T09:41:58.291800Z

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

emilaasa 2021-01-05T09:42:00.291900Z

Hah 🙂

emilaasa 2021-01-05T09:42:55.292900Z

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

Olical 2021-01-05T09:44:31.293700Z

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.

Olical 2021-01-05T09:45:26.294Z

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)

emilaasa 2021-01-05T09:46:20.294200Z

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.

Olical 2021-01-05T09:46:47.294400Z

https://github.com/jlesquembre/coc-conjure here's the support for Conjure + CoC

Olical 2021-01-05T09:46:56.294700Z

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

Olical 2021-01-05T09:47:21.294900Z

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.

emilaasa 2021-01-05T09:47:49.295200Z

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

emilaasa 2021-01-05T09:48:46.295400Z

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

emilaasa 2021-01-05T09:49:20.295600Z

(+ 1 1) ; 2

dharrigan 2021-01-05T09:57:09.295800Z

I use coc-conjure

dharrigan 2021-01-05T09:57:46.296Z

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

dharrigan 2021-01-05T09:57:55.296200Z

It was talked about a bit before the holidays

dharrigan 2021-01-05T09:58:15.296400Z

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

dharrigan 2021-01-05T09:58:36.296600Z

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

Olical 2021-01-05T10:00:07.296800Z

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.

dharrigan 2021-01-05T10:00:26.297Z

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

Olical 2021-01-05T10:00:39.297200Z

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

emilaasa 2021-01-05T10:01:00.297400Z

ah 🙂

Olical 2021-01-05T10:01:28.297600Z

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

emilaasa 2021-01-05T10:01:53.297800Z

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

dharrigan 2021-01-05T10:02:07.298Z

I'll add an issue

emilaasa 2021-01-05T10:02:20.298200Z

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

emilaasa 2021-01-05T10:03:42.298400Z

<c-r>c then?

Olical 2021-01-05T10:05:09.298600Z

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.

emilaasa 2021-01-05T10:05:34.298800Z

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

Olical 2021-01-05T10:07:44.299Z

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?

emilaasa 2021-01-05T10:08:39.299200Z

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

dharrigan 2021-01-05T10:08:43.299400Z

I would support having a differnet mapping

Timofey Sitnikov 2021-01-05T16:49:28.300900Z

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?

enforser 2021-01-05T17:07:54.302400Z

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?

dave 2021-01-05T17:25:34.303800Z

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

dave 2021-01-05T17:26:38.305Z

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

dave 2021-01-05T17:27:29.306100Z

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

dave 2021-01-05T17:27:41.306400Z

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

dave 2021-01-05T17:28:23.306800Z

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

dave 2021-01-05T17:28:41.307400Z

i think conjure and iced give you a lot more features

juhoteperi 2021-01-05T17:29:19.308100Z

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

dave 2021-01-05T17:29:41.308600Z

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

juhoteperi 2021-01-05T17:30:06.309700Z

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

dave 2021-01-05T17:30:15.310Z

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

dave 2021-01-05T17:30:45.310700Z

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

Jan K 2021-01-05T17:36:55.311600Z

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

💯 1
Timofey Sitnikov 2021-01-05T17:54:51.314900Z

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 ...

1
borkdude 2021-01-05T18:01:43.315500Z

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

juhoteperi 2021-01-05T18:02:19.316100Z

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

juhoteperi 2021-01-05T18:04:37.316400Z

https://github.com/liquidz/vim-iced/issues/159

Timofey Sitnikov 2021-01-05T18:07:32.318600Z

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

juhoteperi 2021-01-05T18:08:32.318900Z

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

dave 2021-01-05T18:12:23.319100Z

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 Sitnikov 2021-01-05T18:16:16.319300Z

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.

dave 2021-01-05T19:40:03.319600Z

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

dave 2021-01-05T19:40:19.319800Z

https://github.com/clojure-lsp/clojure-lsp

Timofey Sitnikov 2021-01-05T19:44:18.320100Z

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

Timofey Sitnikov 2021-01-05T19:47:49.320300Z

vim-iced does pretty much everything clojure lsp plugin.