This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # announcements (11)
- # aws (5)
- # babashka (69)
- # beginners (138)
- # calva (5)
- # cider (11)
- # cljsrn (3)
- # clojure (86)
- # clojure-europe (8)
- # clojure-italy (2)
- # clojure-nl (5)
- # clojure-norway (13)
- # clojure-uk (21)
- # clojurescript (13)
- # conjure (58)
- # core-typed (2)
- # data-science (2)
- # datomic (5)
- # degree9 (4)
- # emotion-cljs (4)
- # figwheel-main (8)
- # fulcro (29)
- # graalvm (70)
- # interop (2)
- # joker (1)
- # lein-figwheel (2)
- # leiningen (13)
- # liberator (4)
- # off-topic (21)
- # pedestal (2)
- # re-frame (10)
- # shadow-cljs (42)
- # spacemacs (29)
- # spire (1)
- # tools-deps (11)
- # vim (26)
- # xtdb (5)
Currently, in order to eval an expression in my Cider REPL buffer I have to be in insert mode. Is there a way to eval an expression in normal mode?
Ah, I thought you're talking about clojure buffer.
How about just calling
And what's your use case for evaling expression in normal mode in the REPL buffer?
(Basically anything that works in the standard buffer should work in the repl buffer too)
When I press arrow key up I am able to traverse the history of commands evaled in the REPL
cider-eval-last-sexp works in the REPL buffer but it is a bit weird as it doesn’t create a new line in the REPL
But quite often I need to go to the buffer REPL for a brief moment, re-execute the previous expression and move back to the previous REPL
If you really care about getting the same thing as if pressing Enter manually you could also use
cider-send-last-sexp-to-repl (`, s e` ) - but it's a bit weird in the REPL itself since it duplicates the expression.
,e w might be interesting too
RET in the REPL buffer using Evil normal state should evaluate the current expression. If you have to change to insert mode then perhaps something is incorrect with your setup.
C-j in the REPL buffer in Evil insert state will scroll through REPL buffer history. These keys are very common for scrolling through lists in Spacemacs (e.g. helm lists)
Is there something stopping you from just evaluating the code in the source code buffers? I find the REPL buffer experience quite limited, especially as it requires switching namespaces or require namespace or provide fully qualified names.
@U05254DQM usually I eval expressions from source code buffers. But from time to time, I need to eval expressions form the REPL buffer
@U05254DQM any idea why
RET doesn’t work? I just noticed that
\ RET works.
Are you on an older version of CIDER or Spacemacs? I am using CIDER 0.25.0 (Bergamo) and updated Spacemacs and packages a few days ago.
Otherwise maybe there is something in your
.spacemacs that configures CIDER to behave differently. I believe you can configure multi-line support, but I think that only affects what
RET does in Evil insert (so you can have mutiple lines).
I am assuming you are just jumping to the REPL to run the
(reset) function, you can set up CIDER to drive components when refreshing the repl, so everything would be done in an existing keybinding. If that makes sense, I'll try dig out the code...
I am very eager to learn how to let CIDER drive components when it’s required…
This is what I've learnt so far, its not extensively tested, but should get you close https://practicalli.github.io/spacemacs/clojure-repl/component-lifecycle.html Let me know if the .dir-locals.el setup works for you and if you have better examples of using component to share 🙂
I take it its possible to set functionality on a per projectile basis? things like:
i'll follow up in this thread when i figure out how.
(setq clojure-indent-style 'align-arguments) (setq clojure-indent-style 'always-indent)
I assume this would be done in a
.dir-locals.el file if its on per projectile basis
Not dissimilar to this I guess https://practicalli.github.io/spacemacs/clojure-projects/monorepo-nested-projects.html
or defining default aliases to include for deps.end projects as in this article https://practicalli.github.io/blog/posts/cider-jack-in-to-clojure-cli-projects-from-spacemacs/