This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-02-02
Channels
- # announcements (3)
- # asami (29)
- # babashka (62)
- # beginners (131)
- # biff (7)
- # calva (31)
- # cider (5)
- # clerk (14)
- # clj-kondo (3)
- # cljsrn (12)
- # clojars (18)
- # clojure (72)
- # clojure-austin (17)
- # clojure-dev (6)
- # clojure-europe (31)
- # clojure-indonesia (1)
- # clojure-nl (1)
- # clojure-norway (18)
- # clojure-sweden (11)
- # clojure-uk (6)
- # clr (47)
- # conjure (42)
- # cursive (88)
- # datalevin (2)
- # datomic (25)
- # emacs (42)
- # exercism (1)
- # fulcro (10)
- # funcool (8)
- # gratitude (2)
- # honeysql (16)
- # introduce-yourself (5)
- # jobs-discuss (26)
- # leiningen (5)
- # lsp (31)
- # malli (21)
- # matcher-combinators (14)
- # missionary (2)
- # nbb (1)
- # off-topic (40)
- # pathom (38)
- # portal (2)
- # re-frame (7)
- # reagent (18)
- # reitit (1)
- # releases (5)
- # shadow-cljs (62)
- # sql (12)
- # testing (4)
- # xtdb (37)
We have a "private" repo defined in our project.clj
like so:
:repositories [["private-repo" {:url ""
:username :env/PRIVATE_MVN_USERNAME
:password :env/PRIVATE_MVN_PASSWORD
:sign-releases false
:checksum :fail}]]
Whenever I use Refresh Leiningen Projects
, I get a dependency resolution error.
Works fine from the cli with lein deps
, as long as the env-vars are set up correctly.
So I'm thinking it's related to the missing env vars. Can I somehow get Cursive to resolve those?
@U0567Q30W Hope it's okay to ping you (again 😉) - threads get burried pretty quickly here
So the issue here is that IntelliJ invokes lein in-process to do that operation. That means that IntelliJ itself will have to see those env vars for this to work. Do you know how to make that happen on your distribution?
Ah, okay, that makes sense. I can try launching IntelliJ from bash and see if it will pick up the env vars 👍
No worries! I was thinking about some way to pass env var values to lein through the UI, but I’m guessing you don’t want to be configuring your secrets in the preferences.
Well, it wouldn't be a no-go in this case. I was looking for a place to do that, but I gave up 🤷
It would be nice if it were per-project (like I have .envrc
setup per project-dir), not sure if that would be an IntelliJ feature or a Cursive feature?
In any case, it's not a deal-breaker if I need to launch IDEA with those env vars, so I'll look into that first
So there’s this: https://github.com/ashald/EnvFile, which I did some work to support a while back. But that’s just for run configs. I’ll see if I can hook into it somehow.
Hello friends, I am new to using Cursive. What action can I use to send an expression to a working REPL in the side pane?
u should put your whole question into a single message next time, so it's easier to respond to it on a thread. u can also number the options, so we can refer back to it easily in a response.
i usually just use the "Send top form to REPL", because i can be in the middle of a deeply nested expression and it would still evaluate the whole expression up to the top-level of the file (or to the (comment ...)
expression containing it)
top-form means, it's not within some other expression.
a (comment ...)
expression is an exception though. everything within it is still considered top-level
if u leave expressions within a (comment ...)
in your source code, those are referred to as "Rich comments", because Rich Hickey popularized this tactic.
u can provide examples of how to use adjacent code within such blocks or show the REPL session of the thinking process, which lead to a specific implementation.

I just learned I can go to implementation code with the action "Go to implementation" is there a way to return back to the file where I called this action from?
if u hop on this screen sharing session, i can show u around https://pop.com/j/895-310-241
i love to help with the workflow, because that can make ppl a loooot lot more effective at learning clojure. they can focus on the meat of the language and the std lib, instead of fighting with the tooling.

very little effort at the beginning can save tremendous amount of pain later, so i think it makes a lot of sense to help ppl out, so there can be more clojure programmers out there 🙂
well, see u later then, when u have more time! but keep asking in the meantime and also read thru the official cursive users manual, because it's pretty good and relatively short too.
also https://clojure.org/guides/getting_started is pretty useful
im still referring to it after almost a decade of using clojure, because it's getting extended with docs about newer features, like tools.build

This training session you offered would be great to see as a video of setting stuff up and the basics of using Cursive effectively. I’d love to watch that.
does anyone have a list of ALL Cursive menu items in markdown format? it would be helpful to help others out faster, because we can just copy-paste things, like
`Main Menu` / `Tools` / `REPL` / `Send Form Before Caret to REPL
`
because we can just full-text search such a file.
This is actually trickier to generate than you might think. However I do generate a similar list as part of my documentation generation. I could potentially create a doc page containing this, as well as the settings.
i didn't say generate, just asked if anyone has a list 🙂 if no one has, i will just start typing up a list as need arises
True, but after maintaining my doc by hand for ages, whenever I hear anything like that, I immediately think: generate, don’t maintain by hand 🙂. I’ll see if I can get that into the doc.

similarly a file for the various cursive / clojure preferences would be helpful too, so it's easier to put together a documentation for company-specific, recommended settings
i have to say, that emacs is better in this respect, because i could communicate a set of settings via a trivial program, which sets customization or regular variables, regardless of the categorization (because the setting category is already encoded in the setting name)
I'm not sure why but "Send Form Before Caret to REPL" key binding doesn't seem to work for me I also don't have this action listed in "Find Action" menu
u have to have some expression before your caret. if u r inside some symbol, string or keyword, then there is no complete form before the caret
maybe u can think of this operation as "(the previous complete) form left of the cursor or above the cursor, if there are only spaces left of it"
CIDER for Emacs has a cider-eval-last-sexp
operation and explains last-sexp
as:
> the form preceding the cursor
— https://docs.cider.mx/cider/usage/code_evaluation.html
there is a "form before caret" if the cursor - shown as •
- is at the following positions:
(prn• "asd") 123
(prn "asd"•) 123
(prn "asd")• 123
(prn "asd") • 123
but u the form before caret is deemed ambiguous, if the cursor is in the following positions:
(pr•n "asd") 123
(prn •"asd") 123
(prn "as•d") 123
(prn "asd") •123
(prn "asd") 12•3
so u won't have the Send Form Before Caret to REPL
operation available
at the beginning, i recommend to use the Opt-Up/Down
aka Extend / Shrink Selection
commands to see where the expression boundaries are, until u can see it without explicit selection too.
and when u have already selected some valid and complete forms with these commands, u can use either Send ... to REPL
operations to evaluate that selection.
this way u can even ignore the Send Form Before Caret to REPL
commands and always just use the Send Top Form to REPL
with or without a selection.
it would 2 multiple keystrokes, but since it's a rarely needed operation, it might worth using it, since it requires a simpler mental model.
@U086D6TBN that's so awesome
Would it be possible for REPL configurations to come pre-populated with the selected aliases in a deps.edn project? I have to select the aliases I'm using in the 'Clojure Deps' pane to make the IDE understand my project, and then I also have to specify them in the run configuration for the REPL to make my REPL work. It would be great if Cursive did something clever here (though I confess I've not thought through the consequences), even if it just pre-filled the currently selected aliases at the time you create the run REPL configuration.
The issue that I can think of is that for syncing aliases to a project I usually use the superset of all aliases I might want, to ensure that all the sources are available. For example, you might not want your test alias enabled in your REPL, but you definitely want it for editing.
It's rare that i don't want the test alias enabled in my REPL - or at least I see no harm in having the source on the classpath, but it would be nice not to have the :main-opts. This clearly relates to the other thread: https://clojurians.slack.com/archives/C0744GXCJ/p1675354446280009
On the subject of REPLs and deps.edn files, it would also be nice if the REPL run configurations ignored the :main-opts
of the specified aliases. If you're running a REPL I can't imagine them being useful.
So I recently fixed this (or broke it, depending on your point of view). See https://github.com/cursive-ide/cursive/issues/2322 for some discussion.
I switch those to :exec-fn
to solve that issue. And I assumed that was (part of) the motivation for that feature in tools.deps? But it's not a drop-in replacement.
Just learned I can make my parens rainbow colored 😮 and also I can separate the REPL outputs 🤯 man I'm having so much fun with this
We call this "the Lisp curse". It's so much fun we forget to do the work intended.
