This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-06-27
Channels
- # babashka (39)
- # beginners (256)
- # calva (33)
- # cider (4)
- # clj-otel (8)
- # clojure (48)
- # clojure-denmark (3)
- # clojure-europe (21)
- # clojure-nl (1)
- # clojure-norway (45)
- # clojure-poland (1)
- # clojure-sweden (2)
- # clojure-uk (5)
- # clojuredesign-podcast (5)
- # clr (13)
- # core-async (9)
- # cursive (12)
- # data-science (2)
- # datahike (80)
- # datomic (5)
- # hyperfiddle (14)
- # introduce-yourself (4)
- # jobs (4)
- # lsp (7)
- # missionary (6)
- # polylith (25)
- # proletarian (5)
- # releases (1)
- # shadow-cljs (12)
- # squint (7)
- # xtdb (2)
is there any reason why calva default ctrl + backspace
or ctrl + delete
behavior is to delete whole line and ctrl + shift + backspace
deletes last s-exp and consumes everything between the cursor and the s-exp as well (like comments)? Coming from other IDEs where ctrl + backspace simply eats the last word whatever it is function, comment etc. this feels new. I know I can change it but just trying to understand the rationale of dealing with bigger units at the default. Do lispers feel the need to delete whole lines more often?
Those are not the Calva defaults. If you haven’t changed it, maybe some other extension is in play? See if it happens in, say, a JS file.
Calva ships no default binding for ctrl+shift+backspace
, iirc. The defaults for ctrl+backspace
and ctrl+delete
are to delete to the start or end of the current list, respectively. It’s part of the structural editing. See: https://calva.io/paredit/
sorry it's ctrl + alt + backspace
, my bad.
can you recommend a different combo for barf than ctrl + shift + alt + <=
because that actually moves vs code to another linux desktop on my system.
ctrl+alt+backspace
deletes the previous sexpression, including anything in between there. The rationale is that it is the destructive equivalent to moving a sexpression backwards. Though that command actually is a bit more aware of comments. We should probably align them better.
something like ctrl + alt + ,
would be ideal because it's the opposite of slurp
oh nvm I mistook slurp backward for barf... sorry
i will experiment with paredit more before asking questions
hmm from what I can see slurp does generate a whitespace before the fn name and calva complains each time. are you supposed to del
every time or is this something that has to be configured?
It makes sense to use ctrl+alt+shift+,
and ctrl+alt+shift+.
for slurpSexpBackward
and barfSexpBackward
, respectively on Linux, I think. Maybe we should change the Calva defaults to that…
i do enjoy using c+a+. and c+a+, for slurp and barf respectively to be honest.
4 key shortcuts feel like typing, lol 😄
It was for the backwards versions. You quickly run out of the shorter combos, and the rationale would be that shift
reverses the direction.
That space can’t be configured away. It’s just have proven a bit tricky to get rid of. I hit tab if I don’t want it. What do you mean by “Calva complaining each time”? I see no complaints.
well maybe you clicked on Don't show again. I get this:
Hmm, I don’t think I’ve clicked that. Can you take me through the steps to reproduce it in a minimal file?
ok, after some more extensive testing this doesn't seem to be caused by slurping itself, but rather by where I was trying to slurp. to reproduce start a mini project, then write any function like (+ 1 2) and then right adjacent to it type any word, then go behind the word open parens and slurp, like this:
(ns minimal-clj.playground)
(+ 1 2)(slurp-here)word
I don't get a warning if the slurping is done on a new line on its own.the problem occurs from creating a function that's not supposed to be there as far as I can tell, so actually it's supposed to work like that. you will get the warning even if you try to format it in other ways too.
I guess the warning makes more sense if you are making a conscious formatting, but when it is something as part of another command it gets confusing.
tbh it's mostly fine. if you read the error and think you will get what the problem is. it shouldn't be comfortable to make mistakes. (i think)
if you can figure out how to trim the space when slurping that would be pretty great, barf isn't producing spaces for some reason
In the situations where slurping produces that extra space, you can also try:
1. Expand selection
2. (
(or [
or whatever bracket
Just FYI. This technique works pretty well in other languages as well.
This is a good one I used to highlight the word with the mouse before.
I think on Linux the default shortcut for expand selection is a bit hairy. On Mac it is ctrl+w
.
it's not great: alt + shift + =>
now I get why people buy Macs. that extra keyboard button!
If you have a windows or linux-button on your machine, I think you can use it for bindings in VS Code. Not sure, though, just something I think I saw somewhere.
these look like tekken combos, lol
More like Virtua Fighter! https://gamefaqs.gamespot.com/arcade/583647-virtua-fighter/faqs/1099