Fork me on GitHub
#conjure
<
2020-10-08
>
dharrigan08:10:26

Got round to trying it out

dharrigan08:10:30

works fantastically

dharrigan08:10:13

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

dharrigan08:10:16

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

dharrigan08:10:38

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

Olical08:10:42

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!

practicalli-johnny09:10:26

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?

Olical09:10:29

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.

Olical09:10:52

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-johnny09:10:06

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.

Olical09:10:19

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

Olical09:10:20

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.

Olical09:10:25

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-johnny09:10:12

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

Olical09:10:22

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.

practicalli-johnny09:10:37

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

practicalli-johnny09:10:15

Thank you... more homework for the weekend 🙂

Olical09:10:25

Hehe sorry but also you're welcome 😅

victorb09:10:48

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.

Olical09:10:22

:thinking_face: that's really odd.

Olical09:10:53

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

Olical09:10:04

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

Olical09:10:11

Which will probably be a bunch of #'vars

Olical09:10:27

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

Olical09:10:25

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

victorb09:10:34

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

victorb09:10:48

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

Olical09:10:06

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

Olical09:10:15

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

victorb09:10:11

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

Olical09:10:25

Ah damn, that's unfortunate 😞

victorb09:10:34

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

Olical09:10:48

Yep, so it would require a :w beforehand

victorb09:10:50

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

Olical09:10:53

Which may not work for you

Olical09:10:01

Interesting!

Olical09:10:51

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.

victorb09:10:53

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:

Olical09:10:08

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!)

victorb09:10:11

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!

😊 3
practicalli-johnny13:10:45

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?

Olical13:10:25

Should be tab and shift tab

Olical13:10:32

Can probably be rebound too

practicalli-johnny13:10:16

Doh, its so obvious now.... thanks

practicalli-johnny13:10:54

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

Aron20:10:33

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

practicalli-johnny10:10:50

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?

Aron10:10:57

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

👍 3
Aron10:10:29

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

practicalli-johnny11:10:41

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.

Aron12:10:36

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.