Fork me on GitHub

I’m taking some time to fix some annoyances and short comings with the Spacemacs und clojure/cider integration:

bmo 2

Feedback welcome and if you have any suggestions let me know


I still have on my list, since this bugs me often


@kommen thanks for submitting a pull request, looks very useful. I an unsure about using RET to send input to the repl. Is this just working in the REPL history buffer, in which case that sounds good. If its in the normal REPL buffer, then RET would stop you entering a multi-line expression on the repl. In that case C-RET seems more appropriate.


@jr0cket I just added RET in normal mode to behave the same as in input mode and match the original cider implementation: . right now in spacemacs RET would do nothing as it tried to navigate to the next line in normal mode, but in the repl you’re already on the last line.


C-RET is already bound to cider-repl-closing-return


I am just experimenting with the repl-history. Currently it is definitely confusing to have to switch to vim insert mode to call the buffer history and again switch to vim insert.


I would like to have SPC s h keybinding that opens a buffer with repl history in vim normal mode, which i can navigate quickly between each expression in that history and press RET to push that expression back into the REPL buffer


for bonus points you could evaluate the expression just pushed without having to go into vim insert mode


I am just trying to define what I think would be useful, as I look at what you have suggested.


It would be nice to have different keybindings, one that quits the history after you send the expression (so this is what SPC or RET currently does in vim insert mode), the other that keeps the repl history open.


I don’t use the repl history often, as I mostly use M-p to navigate back, I did’t try yet to customize it


but I’m not sure about your comment regarding RET in normal mode preventing multi line input: multi line input doesn’t work right now with RET, so it is not preventing anything I think


talking about the repl buffer, not the repl history


oh yes, you are correct. It shows how little i use the repl buffer directly..


sorry, slow on the uptake today. So the RET is for vim normal mode, so you can evaluate an expression in the repl buffer without having to go into vim normal mode. if thats right, then you have my full support


yes, this is exactly what I wanted to achieve and what my change does

bananadance 1

no worries, I just want to make sure we’re on the same page and I have somehow a different setup to not waste time on fixing non-issues


just one final query, the P leader key for repl-history, does that mean i can press P in vim normal mode in the repl buffer and it pops up the repl history ? Or have i misunderstood


you have to press , P in normal mode in the repl buffer


ah, so its added to the major mode menu at the top level. I like that, however, my own preference would be , s h for major-mode > cider > history. I am not sure how P means history in a mnemonic way, unless it is for Previous? If P is used in cider itself, then I am okay with that.


or if you wanted a root history, how about using a meaningful symbol, as is used to start the repl. so you could have , s h and , < which both call the repl-history


in cider it is C-c M-p


I prefer , s h and , < as to me it fits into the existing Spacemacs keybindings and mnemonic menu approach. I would be interested to hear from others as to what they prefer. Maybe @ag has some thoughs as they have customised Clojure layer more than myself.


I really appreciate you doing this work though, it really will make using the REPL buffer and history much easier.


I can see , s h be usefull, especially if somebody would want to eval form again, they wouldn’t need to switch to the repl buffer first to get to the history


will wait for further feedback then


and thanks for your feedback!

Daniel Hines20:10:11

@jr0cket, your book has been super helpful. It's helping me get a handle on all the stuff I knew was there but had never tried. Thanks!

Daniel Hines20:10:18

(FYI I finally got joker working. The package exec-path-from-shell seems to have fixed it (and a bunch of other problems too!))

👍 2

@kommen just trying out your pull request as a branch and noticed that RET is not working in the REPL buffer. I think n and p navigation would be good to have too. I opened a clojure source file and started the REPL. I opened the REPL buffer with , s s. Whilst still in Vim normal mode I used , P to open a buffer with the REPL history. That all works very well. I cant jump to each expression (as you can with n and p in vim insert mode). However, I can press RET to send the current expression to the REPL buffer and close the REPL history. With the cursor back in the REPL buffer in Vim normal mode, RET doesnt make the expression evaluate in the REPL buffer, it does nothing. If I switch to Vim insert, i, then of course I can evaluate the expression. I've tried a few examples and it seems something is missing. I'll take a look tomorrow.