Got round to trying it out
works fantastically
Here's my .projections.json
which lives at the root of the project folder
❯ cat .projections.json
{
"src/*.clj": {
"alternate": "test/{}_test.clj",
"type": "source"
},
"test/*_test.clj": {
"alternate": "src/{}.clj",
"type": "test"
}
}
Using that, I can swap between test and src, if one follows normal naming conventions 🙂
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!
indeedth!
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?
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.
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)
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.
Ah I see! Yeah in that case keeping a log open will be handy
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.
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.
The biggest challenge I have is learning vim commands / keybindings. The conjure part is pretty straight forward :)
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.
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.
:thinking_face: that's really odd.
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
You then get a result for each form (or should do, anyway)
Which will probably be a bunch of #'vars
Is that what you see? But for some reason there's no error when you eval it all together?
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
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
it doesn't stop evaluation the rest of the buffer on error maybe?
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
If you use ,ef it would probably stop and show the error
yeah, indeed that's what happened, seems the error was there, but missed it because of the other successful calls
Ah damn, that's unfortunate 😞
hm, yeah, but "<Leader> e f" would evaluate the file on disk, not buffer right?
Yep, so it would require a :w
beforehand
I do think vim-fireplace when evaluating the entire buffer stops on error
Which may not work for you
Interesting!
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.
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:
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!)
sounds very useful, is that in a shared config somewhere?
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!
Is it these https://github.com/Olical/dotfiles/blob/master/stowed/.config/nvim/fnl/dotfiles/module/mapping.fnl#L20
It's a combination of https://github.com/Olical/dotfiles/blob/master/stowed/.config/nvim/fnl/dotfiles/module/mapping.fnl Yep And also https://github.com/liuchengxu/vim-better-default
https://github.com/liuchengxu/vim-better-default/wiki/a-brief-introduction-to-key-bindings
Thank you... more homework for the weekend 🙂
Hehe sorry but also you're welcome 😅
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?
Should be tab and shift tab
Can probably be rebound too
Doh, its so obvious now.... thanks
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...
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?
I just use it inside vim for navigation, preview and opening files, so https://github.com/francoiscabrol/ranger.vim I use this
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
neovim*
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.
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.
if this is not a specific choice, I can recommend ranger.