This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # 100-days-of-code (2)
- # announcements (1)
- # beginners (41)
- # boot (1)
- # calva (3)
- # cider (25)
- # cljdoc (20)
- # cljs-dev (24)
- # clojure (16)
- # clojure-conj (1)
- # clojure-dev (9)
- # clojure-germany (1)
- # clojure-italy (4)
- # clojure-uk (8)
- # clojurescript (25)
- # community-development (14)
- # cursive (4)
- # datascript (2)
- # datomic (20)
- # duct (16)
- # emacs (12)
- # fulcro (168)
- # graphql (1)
- # keechma (3)
- # leiningen (1)
- # luminus (5)
- # off-topic (13)
- # re-frame (8)
- # reagent (3)
- # rum (1)
- # shadow-cljs (24)
- # spacemacs (32)
- # unrepl (2)
- # vim (2)
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
I still have https://github.com/syl20bnr/spacemacs/issues/4124 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: 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.
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
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
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
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
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
, 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
@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!
(FYI I finally got joker working. The package
exec-path-from-shell seems to have fixed it (and a bunch of other problems too!))
@kommen just trying out your pull request as a branch and noticed that
RET is not working in the REPL buffer. I think
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
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.