This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # architecture (8)
- # beginners (78)
- # boot (20)
- # cider (81)
- # clara (53)
- # cljdoc (10)
- # cljsjs (3)
- # clojure (55)
- # clojure-boston (1)
- # clojure-dev (25)
- # clojure-nl (3)
- # clojure-uk (65)
- # clojurescript (65)
- # core-async (1)
- # cursive (41)
- # data-science (4)
- # datomic (16)
- # editors (74)
- # emacs (17)
- # events (1)
- # figwheel (3)
- # hyperfiddle (39)
- # immutant (16)
- # jobs-discuss (62)
- # juxt (2)
- # keechma (2)
- # leiningen (6)
- # mount (7)
- # nrepl (1)
- # off-topic (30)
- # onyx (14)
- # protorepl (2)
- # re-frame (4)
- # reagent (15)
- # reitit (19)
- # shadow-cljs (102)
- # sim-testing (1)
- # spacemacs (44)
- # specter (15)
- # tools-deps (50)
- # vim (2)
I’d like to have
RET insert a newline in the CIDER repl and
C-<return> evaluate the sexp. I’ve tried entering the following into my
, and this makes the
;; make cider repl indent and newline on enter and eval on ;; control-enter (define-key cider-repl-mode-map (kbd "RET") #'cider-repl-newline-and-indent) (define-key cider-repl-mode-map (kbd "C-<return>") #'cider-repl-return)
RETbehaviour correct, but I cannot trigger
C-<return>with my control key and enter key. Through other means, I can trigger it, if I do
M-x) and then search for
cider-repl-return. Anyone know how to fix this? 🙂
@reefersleep dunno if there's something special about binding
C-RET, but you might use
SPC h d k to see what it's bound to, both before and after the attempt to bind it.
I know that probably doesn't help but i've been loving it. to go to a new line i've just been deleting the last closing parens real quick before I hit RET. And then when I'm done with the multiline input I use the C-RET to get it all closed up nicely.
I've never really done it that way; I should try it. I usually just write my multiline stuff in whatever regular clj/s buffer I have handy, and then send it over to the REPL with
, s e.
Yeah, i think as i get more experienced I'll go that route. Right now, repl first tinkering seems more natural for me because I'm getting tons of errors and using the (doc f) capability a lot! Plus the tutorials are half throwaway examples that I alter in various ways just to see what will happen so I find it easier to just stay in the repl for those. when i start building a real program i'll go the other way. I didn't know , can sub in for SPC-m though. One keystroke saved!
Yeah, or you can set it to some other key if you prefer, it's
Yeah, I mean I write throwaway REPL code in whatever buffer is handy...I don't keep it there typically. I'm only using it as an easy way to write and edit multiline expressions.
cool. and then you just delete it from your program file? or do you have multiple buffers hooked into the same repl session?
Er...both. May not quite be understanding the question properly 🙂
, c s to get a scratch clojure-formatted buffer.
ok. yeah i'm probably not explaining. basically i create a new project using lein like
lein new app brave-book and I just do all the exercises in the core.clj file hooked into a repl. so it's probably not a emulation of how it is working in a real project.
I bind it in my .spacemacs:
(with-eval-after-load 'clojure-mode (define-key evil-normal-state-map (kbd ", c s") 'cider-scratch) )
Oh, yeah, in that case I'd likely just type it in the
core.clj and then delete after sending to REPL (or else do a repeated edit-send cycle until I get to a version I'm happy with, and then leave it in
core.clj, if it's something I actually want to keep).
i gotcha. this cider-scratch thing is neat. that could be handy for random tinkering. when people say they add something to their .spacemacs does that mean you put that function within the dotspacemacs/user-config function?
Yep, correct. Along with a bunch of other clj-specific bindings (you can put all of them within the same
(with-eval-after-load 'clojure-mode ...), no need to repeat that).
Mine are all at https://github.com/eggsyntax/dotfiles/blob/master/.spacemacs if you're curious (but it's messy as hell, there are lots of easier-to-read ones out there).
nice. I'll bookmark it. I'm trying to learn "default Spacemacs" (which is probably considered absurd considering it's a heavily customized emacs already) before I change things too much.
Totally. In the long run you'll probably want a bunch of custom keybindings, that actually seems to be the most common case 😉
This, which I find super-useful: https://github.com/candid82/flycheck-joker
Totally! You'll want to read at least this bit to learn how to configure it to avert false positives: https://github.com/candid82/joker#reducing-false-positives
cool. i'm tabling it for now but i will look into it soon. I have to figure out how to install joker and a couple other tweaks it seems. This is the rabbit hole that keeps me from doing actual clojure programming. hahaha. i knew opening up slack was a risk!
Hmm, glancing back, I'm not sure there's any good reason to have both
syntax-checking, I'll have to look into that. Anyone else know offhand?
i do know that after adding clojure-lint and then commenting it out my spacemacs was all out of wack! lol. I had no syntax highlighting and all kinds of fun weirdness. I had to re-add a few packages to get back to normal. Thanks eggsyntax! Lol. I kid, I kid.
@chase-lambert OK, looking back at discussion on my work slack, I actually meant the
syntax-checking layer. I'm not sure why
clojure-lint is in there, I'll try pulling it out when I get a chance. If you turn it on, then a) have to have
joker on your path, and b) have to restart spacemacs.
Sorry for misleading!
no worries! it's really my own damn fault for immediately installing something after 10 seconds of thought and foresight. a lesson i've learned too many times. people would be appalled at the amount of full powerwashes I do of my chromebook just cuz I'm ocd about one thing not working right and wanting everything fresh.