This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-06-01
Channels
- # announcements (20)
- # babashka (3)
- # beginners (30)
- # calva (28)
- # cider (3)
- # circleci (4)
- # clerk (27)
- # clj-kondo (72)
- # cljdoc (15)
- # cljs-dev (1)
- # clojure (85)
- # clojure-europe (37)
- # clojure-nl (1)
- # clojure-norway (13)
- # clojure-spec (7)
- # clojurescript (19)
- # clr (1)
- # conjure (11)
- # datahike (2)
- # datomic (11)
- # emacs (26)
- # events (4)
- # hoplon (35)
- # hyperfiddle (41)
- # jobs (7)
- # lsp (10)
- # nrepl (3)
- # off-topic (57)
- # portal (47)
- # practicalli (1)
- # rdf (3)
- # reitit (21)
- # releases (1)
- # testing (6)
- # tools-build (16)
- # wasm (1)
- # xtdb (16)
in the REPL, is there a way to automatically require
the correct namespace on autocomplete? example (json/read-value
within the source files knows to require
[jsonista.core :as jsonista]
- but if I do the same in the repl, it just stares at me rather dumbly - I need to use fully qualified names
You mean the REPL prompt, right? clojure-lsp (which provides the auto-require) is not active there, because reasons. Generally the advice is to not use the REPL prompt, and instead use comment
forms in the source files (a.k.a. Rich Comments), and/or “fiddle” files in a dev
source path.
I enjoyed this episode of #clojuredesign-podcast a lot (well, I enjoyed all their episodes, but this one is on the fiddle file subject) https://clojuredesign.club/episode/014-fiddle-with-the-repl/
My rule of thumb: never* type directly into the REPL -- always use comment
in a source file and eval from there. Stu Halloway has made this point in a couple of his presentations -- and you'll hear that from a lot of long-time Clojurians 🙂
*never: except for absolutely one-off, throwaway expressions perhaps... ...I may type a calculation directly into the REPL instead of reaching for a calculator, for example 🙂
Finally got my keybindings ported from Cursive to Calva. These simple and easy to remember bindings have been pretty useful for me over the years - it is basically just code movement and light manipulation using modifiers + WASD keys, like in a FPS game. Posting it here in case it is useful for anyone else. https://gist.github.com/isaksky/94128cda6297e560dbe75650611993c1
Thanks! A PR is welcome to make http://calva.io point to that gist somehow. There’s a page for Customizing Calva where it might fit.
Dear Calva friends: https://github.com/BetterThanTomorrow/calva/releases/tag/v2.0.367 • https://github.com/BetterThanTomorrow/calva/issues/2033 And we had v2.0.366 earlier today with: • https://github.com/BetterThanTomorrow/calva/issues/2212
I hadn't realized how much the previous behavior was until you "fixed" it! Thank you!
I have a custom REPL snippet bound to (def $selection)
so being able to just shift+alt+right
a few times and the ctrl+space d
is sooo much more convenient for me!
I think you might be using custom shortcuts there, @U04V70XH6, not quite following what’s going on. 😃
shift+alt+right
is Calva Paredit Expand Selection for me -- is that not the default?
ctrl+space d
is my REPL snippet to (def $selection)
Previously, selecting the symbol and the expression in a let
was more work. So I'm happy.
Ah, on mac the general grow selection is bound to ctrl+w
by default. shift+alt+right
expands it a sexpression at a time forwards. But I think my real problem was that I thought you were referring to the new $selection-closing-bracket
somehow. 😃
Ah, got it. ctrl+w
is close window for me (Windows).
Here’s how the new $selection-closing-brackets
can be used to create a command similar to Evaluate Selection, Closing Brackets, but that will instead tap it. (Maybe to #C0185BFLLSE.)
If I have (let [a (inc| b)] ...)
with the cursor after inc
like that -- what is $current-pair
?
Current pair would be a (inc b)
from this (let [a |(inc b)] …)
, and (I think) also from this (let [a |(inc b)|] …)
Hmm, good to know. I think I'll stick with $selection
since I mostly start with the cursor embedded in a form and the visual highlighting of the selection is an easier guide to what will get def
'd than just trying to move the cursor "up" to the outside of a form.
As an emacs user who’s curious, this was one of the non negotiable things I wouldn’t switch without. Good job