Fork me on GitHub
#spacemacs
<
2018-10-13
>
kommen08:10:43

I’m taking some time to fix some annoyances and short comings with the Spacemacs und clojure/cider integration: https://github.com/syl20bnr/spacemacs/pull/11431

bmo 8
kommen08:10:14

Feedback welcome and if you have any suggestions let me know

kommen08:10:21

I still have https://github.com/syl20bnr/spacemacs/issues/4124 on my list, since this bugs me often

practicalli-johnny12:10:17

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

kommen12:10:56

@jr0cket I just added RET in normal mode to behave the same as in input mode and match the original cider implementation: https://github.com/clojure-emacs/cider/blob/6d6aa42ecf5bad9110cc0a781e7786b87812b624/cider-repl.el#L1592 . 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.

kommen12:10:32

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

practicalli-johnny12:10:53

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.

practicalli-johnny12:10:21

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

practicalli-johnny12:10:02

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

practicalli-johnny12:10:43

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

practicalli-johnny12:10:11

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.

kommen12:10:09

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

kommen12:10:52

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

kommen12:10:30

talking about the repl buffer, not the repl history

practicalli-johnny12:10:50

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

practicalli-johnny12:10:09

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

kommen12:10:00

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

bananadance 4
kommen12:10:34

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

practicalli-johnny13:10:28

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

kommen13:10:13

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

practicalli-johnny13:10:05

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.

practicalli-johnny13:10:29

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

kommen13:10:32

in cider it is C-c M-p

practicalli-johnny13:10:44

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.

practicalli-johnny13:10:39

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

kommen13:10:27

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

kommen13:10:01

will wait for further feedback then

kommen13:10:12

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

👍 8
practicalli-johnny23:10:27

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