conjure

:neovim:+:clj: https://github.com/Olical/conjure - If you're enjoying Conjure and want to say thanks: https://github.com/users/Olical/sponsorship :smile: (alt https://conjure.fun/discord)
dharrigan 2020-10-08T08:04:26.065300Z

Got round to trying it out

dharrigan 2020-10-08T08:04:30.065500Z

works fantastically

dharrigan 2020-10-08T08:07:13.065800Z

Here's my .projections.json which lives at the root of the project folder

dharrigan 2020-10-08T08:07:16.066Z

❯ cat .projections.json 
{
  "src/*.clj": {
    "alternate": "test/{}_test.clj",
    "type": "source"
  },
  "test/*_test.clj": {
    "alternate": "src/{}.clj",
    "type": "test"
  }
}

dharrigan 2020-10-08T08:07:38.066400Z

Using that, I can swap between test and src, if one follows normal naming conventions 🙂

Olical 2020-10-08T08:26:42.066900Z

ooo nice 😄 I used it a loooong time ago in JS land but I thought it'd work for this case too. tpope to the rescue!

dharrigan 2020-10-08T08:38:51.067100Z

indeedth!

practicalli-john 2020-10-08T09:09:26.070500Z

Beginner question: I opened neovim, started the repl with :Clj , connected to the repl with , c f and opened the repl log with , l v but I dont know how to switch focus between the repl log and my source code... what is the command or keybinding?

Olical 2020-10-08T09:10:29.071200Z

It's just a regular nvim window so you can use <c-w> and then hjkl to navigate or <c-w><c-w> to hop between your most recent windows.

Olical 2020-10-08T09:10:52.071800Z

You can also just keep the log window/buffer closed until you need it and rely on the HUD for glancing at results (which is what I do)

practicalli-john 2020-10-08T09:17:06.075Z

Thanks, thats useful because I just experiemented with the :sb* commands and now have lots of splits in the tab :) I am using a large font for demos, so the HUD window is sometimes too small, but I see I can open the log in a separate tab which should work too. When not demo'ing, the font would be smaller and the HUD would be just fine. Thanks again.

Olical 2020-10-08T09:18:19.075300Z

Ah I see! Yeah in that case keeping a log open will be handy

Olical 2020-10-08T09:19:20.076600Z

I tried to make it as flexible as possible because everyone's different. And I tried to make it "just work" for most cases. So if the log is open and you can see the last line the HUD won't appear because it knows you're using the log to see results. If you have opened the log and scrolled up (to view some historical thing) it'll show the HUD because it knows you can't see the new results in the log.

Olical 2020-10-08T09:20:25.077700Z

I tend to open my splits / tabs for some specific interaction then close it. So my log windows are very temporary, but do whatever works for you! You can also make it so the HUD takes up the full width or height of your editor, if you so choose.

practicalli-john 2020-10-08T09:22:12.079600Z

The biggest challenge I have is learning vim commands / keybindings. The conjure part is pretty straight forward :)

Olical 2020-10-08T09:23:22.081600Z

I mapped a bunch of spacemacs like mappings for all my window interactions which helps 😅 so to open and close different kinds of splits it's all <space>w... prefixed.

victorb 2020-10-08T09:23:48.082200Z

Hm, not sure if it's a bug with conjure, my particular setup or me simply misunderstanding. Basically, I had a compilation error in a multimethod and I was evaluating the entire buffer with "<Leader> e b", it show no errors, and after a while I kind of lost my mind why it didn't seem to update correctly. It wasn't until after evaluating the multimethod form itself with "<Leader> e e" that the error actually showed in the conjure window.

Olical 2020-10-08T09:25:22.082300Z

:thinking_face: that's really odd.

Olical 2020-10-08T09:25:53.082500Z

Normally when you eval a buffer it sends all the text to the REPL which essentially ends up being a form by form eval of the entire ns

Olical 2020-10-08T09:26:04.082700Z

You then get a result for each form (or should do, anyway)

Olical 2020-10-08T09:26:11.082900Z

Which will probably be a bunch of #'vars

Olical 2020-10-08T09:26:27.083100Z

Is that what you see? But for some reason there's no error when you eval it all together?

Olical 2020-10-08T09:28:25.083300Z

I'm wondering if you saw some result from the form or it was kinda silent when it got to the one with a compilation error

victorb 2020-10-08T09:28:34.083500Z

yeah, that was what I was thinking too. Yeah, I saw a bunch of results but actually now when you say it, could be that the form with the error was so far up the file, that the successful evaluations after hid the error above the scrollback

victorb 2020-10-08T09:28:48.083700Z

it doesn't stop evaluation the rest of the buffer on error maybe?

Olical 2020-10-08T09:29:06.083900Z

I don't think it does, that's just how nREPL works, you throw 100 forms at it, you get 100 results back, some may be errors

Olical 2020-10-08T09:29:15.084100Z

If you use ,ef it would probably stop and show the error

victorb 2020-10-08T09:30:11.084300Z

yeah, indeed that's what happened, seems the error was there, but missed it because of the other successful calls

Olical 2020-10-08T09:30:25.084900Z

Ah damn, that's unfortunate 😞

victorb 2020-10-08T09:30:34.085100Z

hm, yeah, but "<Leader> e f" would evaluate the file on disk, not buffer right?

Olical 2020-10-08T09:30:48.085300Z

Yep, so it would require a :w beforehand

victorb 2020-10-08T09:30:50.085500Z

I do think vim-fireplace when evaluating the entire buffer stops on error

Olical 2020-10-08T09:30:53.085700Z

Which may not work for you

Olical 2020-10-08T09:31:01.085900Z

Interesting!

Olical 2020-10-08T09:31:51.086100Z

When evaluating from the buffer and not from the file? I wonder how they're doing that :thinking_face: unless they eval one form at a time and wait for each result before sending the next one. I find that hard to believe.

victorb 2020-10-08T09:31:53.086300Z

anyways, problem found and can work around it, somehow for sure. Thanks for an awesome plugin otherwise, coming from vim-fireplace to conjure and so far, only "issue" that has left me confused, everything else is working :thumbsup: :thumbsup: :thumbsup:

Olical 2020-10-08T09:33:08.086500Z

That's great to hear! I'm hoping to have some updates out over the next few days, I've been in a bit of a OSS productivity slump and haven't made a release for a couple of weeks. Excited to get more languages supported and more Clojure improvements across the line. Need to make use of nREPL 0.8's built in info and completion ops (no middleware required!)

practicalli-john 2020-10-08T09:33:37.086700Z

sounds very useful, is that in a shared config somewhere?

victorb 2020-10-08T09:34:11.086900Z

That happens, don't stress about it, supposed to be fun, so that's the most important 🙂 Yeah, that'd be really nice features indeed!

😊 1
practicalli-john 2020-10-08T09:37:15.088Z

Thank you... more homework for the weekend 🙂

Olical 2020-10-08T09:37:25.088200Z

Hehe sorry but also you're welcome 😅

practicalli-john 2020-10-08T13:17:45.089700Z

when I type :f and press tab I get a completion menu popup, but I cant seem to find the key bindings that navigate it (maybe its entries are not select-able). Any ideas?

Olical 2020-10-08T13:18:25.090Z

Should be tab and shift tab

Olical 2020-10-08T13:18:32.090200Z

Can probably be rebound too

practicalli-john 2020-10-08T13:19:16.090400Z

Doh, its so obvious now.... thanks

practicalli-john 2020-10-08T13:23:54.093100Z

I am now discovering the joy of NerdTree. I found something strange when using :find , it would only load NerdTree if I was not in the root directory of a project, eg. have a source code file open. Using :find with a deps.edn file open from the root directory would do nothing... :NerdTree command seems to work find anywhere...

practicalli-john 2020-10-09T10:09:50.093400Z

Yes, I like ranger. I use it with Spacemacs and on the command line. There seems to be a few packages for ranger, any preference?

Aron 2020-10-09T10:38:57.093600Z

I just use it inside vim for navigation, preview and opening files, so https://github.com/francoiscabrol/ranger.vim I use this

👍 1
Aron 2020-10-09T10:39:29.093900Z

sometimes I forget not to open nested vims through it, but I have to say that I am very much not a power vim user, I just get by with the bare minimum

Aron 2020-10-09T10:39:54.094100Z

neovim*

practicalli-john 2020-10-09T11:55:41.094400Z

I thought I new vim when I started using neovim, after using vim-style editing in Spacemacs. But there are quite a few differences outside of just editing a file, but getting there steadily. Thanks for the link.

Aron 2020-10-09T12:06:36.094600Z

Yeah, it's quite different, probably going the other way, from neovim to spacemacs, is easier. But I am fairly sure you could teach me more about vim than I could teach you. Even though I've been using it since 2009, there is only one thing that I think I do that few other people use: set scrolloff=500 to keep the cursorline centered vertically. all the rest of my config is just random stuff I copy pasted and hope it's not clashing with each other too much.

Aron 2020-10-08T20:38:33.093200Z

if this is not a specific choice, I can recommend ranger.