Fork me on GitHub

what is a tools.depsy way of starting (--interactive) REPL-y connected to nrepl?

:repl {:extra-deps {nrepl {:mvn/version "0.7.0"}
		              reply {:mvn/version "0.4.4"}}
         :main-opts ["-e" "(require,'[reply.main]),(defn,reply,[_,port,_],(reply.main/launch-nrepl,{:attach,(str,\"\",port)})),(ns,user)"
      	             "-m" "nrepl.cmdline" "-i" "-f" "user/reply"]}}
this works (ish), but feels complex + does not exit nrepl once REPL-y is done (ctrl c / ctrl d)


do you want to start your nREPL server with the same command?


I have this:

{:extra-deps {reply {:mvn/version "0.4.4"}}
   :main-opts ["-m" "reply.main" "--attach" "1337"]}


but that's to attach to an already running nREPL


right nrepl + REPL-y connected to it. I do most of the work in a vi + terminal REPL


*right => "start your nREPL server with the same command"


nrepl.cmdline optionally takes a repl-fn / -f for the interactive repling


I think, for simplicity's sake, I'd be inclined to use two separate aliases: one to start an nREPL server (and leave it running in a window, or run it in the background), and a second alias to start REPL-y connected to that background process.


I can understand wanting a single command, but I'd probably write a small shell script that just ran two clojure commands if it proved too annoying to run those two commands manually.


@seancorfield definitely a possibility, but if I work with several (different) apps that's a twofold repl things to run and exit from I am just looking for "lein repl" / "boot repl" repl-y like experience with deps.edn


Hmm, I never type into a REPL so I only care what my editor integration does. Why do you need REPL-y, specifically @tolitius?


I always type into repl )


it's connected to vi where I "finalize" my thoughts after I am done thinking in repl


and vice versa compile/reload from vi back to repl tp keep thinking


I "think" in a "Rich Comment Form" in my editor -- like Stu Halloway talks about in some of his presos


yea, a lot of Clojure devs use an integrated playground to "think" that is just connected to nrepl that runs in the background. I like terminals, terminal repl works best for me since I am focused on small fragments of code at a time. with REPL-y this experience is simple, so I am just looking to get there with deps.edn


which I did get with an above alias but it rather feels off + does not exit the nrepl on ctrl c/d


I think you're stuck with the complex/almost-works invocation for now. I'll have a think about it on and off and come back if I figure out anything better.


yea, nothing urgent, I was just wondering whether I am missing something obvious, i.e. a flag, an option, etc..


(I don't use nREPL at all so it'll be a fun experiment/diversion)


good luck and thank you )


@tolitius Hey 😉 I am using For your exact use case and I found some problems with multi-line expressions sometimes, I am pretty happy with it. I have two aliases I can share (the second is for cljs) not in front of the keyboard now though. Will sent them soon.