This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-04-29
Channels
- # babashka (30)
- # beginners (207)
- # biff (3)
- # calva (10)
- # cljs-dev (3)
- # clojure (34)
- # clojure-austin (3)
- # clojure-bay-area (1)
- # clojure-dev (3)
- # clojure-europe (31)
- # clojure-nl (1)
- # clojure-norway (37)
- # clojure-uk (8)
- # community-development (3)
- # core-async (4)
- # data-science (1)
- # dev-tooling (2)
- # emacs (4)
- # etaoin (12)
- # fulcro (7)
- # gratitude (1)
- # hyperfiddle (7)
- # jobs-discuss (191)
- # lsp (15)
- # malli (1)
- # other-languages (11)
- # overtone (1)
- # pathom (3)
- # pedestal (1)
- # polylith (21)
- # releases (1)
- # squint (5)
- # yamlscript (5)
A question about Paredit + Vim (via Neovim in my case, if that's important) and Calva. Suppose I have this code:
(expression (sdf|sd) "asdfsd" ) ;; comment
with the text cursor being where the |
is.
In regular Vim, pressing shift+d
would then turn it into (expression (sdf
, thus breaking the balance.
Apparently, Vim + Fireplace would result in (expression (sdf))
.
Is there some way this could work in Cursive as well? I tried looking in the settings but couldn't find anything.I don’t know anything about how Vim or Neovim works with VS Code. But I imagine it would be a matter f mapping D
to a Paredit command. However, there is no Paredit command like that in Calva, so I think that means “no” to the question.
Closest equivalent I can think of is Paredit Kill Forwards. It would result in
(expression (sdf|) "asdfsd" ) ;; comment
Then it would refuse to delete anything more. And you could do forward down and then kill forward again.
(expression (sdf)|) ;; comment
And once more to kill the comment.Would be interesting to learn about why/when it makes sense to delete like that. I don’t think it’s super hard to implement.
It's just my curiosity. :) Prompted by learning what Fireplace does in that case. I was certain that at some point I saw a setting like "perform all the edit actions without making parens unbalanced", but I've probably hallucinated it. And I also occasionally do mess up the balancing because of how Vim works. Trivial to fix of course, but that still got me curious about possibilities out there.
Calva has a command for healing the structure using the indentation. So in theory it could be a matter of stringing together the raw D
command with Infer parens. But only in theory, because the infer command is a bit dangerous, operating on the whole file, and out of sight something may not be properly indented…
is there any way to disable "Welcome to Calva" thing? my sidebar is usually collapsed and it shows up on every launch of a clojure project.