calva

Wednesdays you might find @U0ETXRFEW in the Gather Calva space. Invite is https://gather.town/invite?token=GZqrm7CR and the password is `Be kind`.
practicalli-john 2021-01-03T02:51:28.124500Z

I am unsure what the command calva.toggleKeybindingsEnabled . It seems to be a way to add custom keybindings? Is that right?

pez 2021-01-03T10:08:52.129200Z

We just removed the default shortcut for that command, @jr0cket. It was a mistake that caused a lot of confusion. People would unknowingly press that combo and all Calva shortcuts were gone. Just noting this since I know you are building a shortcut binding scheme.

practicalli-john 2021-01-03T11:34:10.129400Z

Ops, I ran the command. The shortcuts I'm defining are in the Vspacemacs extension though, so not affected. I'll check if I still havethe usual Calva keybindings 😆

pez 2021-01-03T11:45:53.129600Z

It’s a toggle command so easy to restore. If you realize that that is what has happened, which is not always easy to realize.

bringe 2021-01-03T02:53:22.124600Z

It disables/enables basically all Calva keybindings

bringe 2021-01-03T02:54:00.124800Z

Someone had a workflow in which Calva's keybindings got in the way of other bindings, and they wanted to be able to quickly disable then, perform some action, and re-enable them

bringe 2021-01-03T02:54:12.125Z

Several times in a work session, so they contributed this command

practicalli-john 2021-01-03T02:54:28.125200Z

Ah, I did see something in the docs about that, just didnt make the connection to the command name. Thanks.

bringe 2021-01-03T02:54:40.125400Z

No prob

pez 2021-01-03T14:20:08.136200Z

Dear Calva friends. This is the last day on my short winter-leave from my daytime job. You’ll probably notice a bit of a lowering in the pace with which I can hack on Calva, and also a bit longer response times here from me. I have had a blast these last days, enjoying the nice coop with @brandon.ringe and also @ericdallo. Today I have made some changes to Calva mostly having to do with the Calva startup experience, and also added some settings for controlling which windows/panes that are automatically opened on start and on jack-in. Experienced Calva users might want to have a bit less of the holding of hands. I’ve just released these changes, together with the new command for opening the code where the current repl namespace is defined. Please enjoy Calva v2.0.145: • https://github.com/BetterThanTomorrow/calva/issues/920https://github.com/BetterThanTomorrow/calva/issues/922https://github.com/BetterThanTomorrow/calva/issues/923https://github.com/BetterThanTomorrow/calva/issues/923https://github.com/BetterThanTomorrow/calva/issues/923https://github.com/BetterThanTomorrow/calva/issues/923`ctrl+alt+c n`

4
🎉 2
bastilla 2021-01-03T14:56:20.139200Z

Happy New Year, folks! So, when I have (func a b) and I want to put this in (func-2 (func a b), I start writing (func-2 but I cannot place the closing paren as it is fixed: (func-2) (func a b) How can I undo this setting? Thanks!

bastilla 2021-01-03T14:59:19.139400Z

To be clear, I want: (func-2 (func a b)) But I cannot type this. Calva allows me (func-2) (func a b).

pavlosmelissinos 2021-01-03T14:59:39.139600Z

Take a look at the paredit docs: https://calva.io/paredit/ slurp forward in particular

bastilla 2021-01-03T15:11:35.141700Z

Ok, thanks to @pavlos and playing with settings.json I found out you can disable paredit by adding "calva.paredit.defaultKeyMap": "none", Thanks.

pavlosmelissinos 2021-01-03T15:15:18.141800Z

Uh, I'd advise against disabling paredit altogether unless you're prepared to start counting parentheses. Structural editing takes some getting used to but it's really the only thing standing between you and insanity when coding in a lisp 😛

practicalli-john 2021-01-03T15:39:51.147100Z

Created pull request on VSpaceCode project to add key bindings for Calva. https://github.com/VSpaceCode/VSpaceCode/pull/154 VSpaceCode brings a Spacemacs style mnemonic keyboard driven menu (using the VS Code command pallete). New key bindings in the VSpacemacs PR are for the Clojure major mode, so for example you can start a REPL using , ' and evaluate a top level expression using , e f To use VSpaceCode, the only change suggested for Calva is to rebind the clearing of evaluation results from Esc to Shift-Esc The design of the key bindings is also in a text document here: https://gist.github.com/889cd50a59f601698b7f83e39c1e4b0b I will add some documentation to the VSpaceCode website and to the http://calva.io website

1
bastilla 2021-01-03T15:40:47.147200Z

barriers to clojureworld are high enough for me. (The language is the smallest part in this.) But I appreciate your concerns.

👍 2
pez 2021-01-03T15:58:20.148100Z

There is a setting for disabling the autoclosing parens. I don’t recommend it, but it is there. See Clojure Defaults here: https://calva.io/customizing/

pez 2021-01-03T16:06:40.148600Z

I recommend keeping it autoclosing and followig @pavlos’s advice about slurping forward. That said, I don’t think slurping is necessary for this particiular case, unless I’ve misunderstood something.

pavlosmelissinos 2021-01-03T16:17:18.149Z

I think the question was how to turn (func a b) into (func-2 (func a b)) So one way is: 1. add (func-2) before the expression (like @bastilla said): (func-2) (func a b) 2. then place the cursor right after the 2 : (func-2|) (func a b) 3. slurp forward: (func-2 (func a b))

pez 2021-01-03T16:32:27.149200Z

Ah, yes, I did misunderstand. So I would do it the slurpy way too. It can also be done by first using the Grow Selection command until (func a b) is selected, then type a (. This will wrap it all in parens and place the cursor inside the last closing one. Then navigate to the opening paren (either by Backward sexp or Backward to List Start/Open), then type func-2. Like so:

👍 1
🙏 1
pez 2021-01-03T16:35:34.150800Z

Nice, @jr0cket! A note about the toggleKeybidings command. It is not deprecrated. We just stopped providing a default shortcut for it.

pez 2021-01-03T17:16:31.151100Z

I think it is a big mistake to disable paredit, but whatever floats your boat!

bringe 2021-01-03T19:22:58.152Z

@ajoberstar Thanks for the sponsorship! ❤️ :calva:

bringe 2021-01-03T19:23:58.152100Z

Mind if we put you under the sponsors section of the readme?

ajoberstar 2021-01-03T19:24:21.152600Z

You're welcome to add me there. Glad to support the Clojure tooling community!

👍 1
pez 2021-01-03T19:25:26.153700Z

Yes, thanks, @ajoberstar! Wonderful that you find Calva worth sponsoring!

pez 2021-01-03T20:34:03.154800Z

Does anyone know if ^ is used in symbol names anywhere? @sogaiu?

Lars Nilsson 2021-01-03T21:10:00.155700Z

Symbols begin with a non-numeric character and can contain alphanumeric characters and *, +, !, -, _, ', ?, <, > and = (other characters may be allowed eventually).
From https://clojure.org/reference/reader.

Lars Nilsson 2021-01-03T21:10:39.156100Z

However

Lars Nilsson 2021-01-03T21:10:44.156400Z

(def foo^bar 10)
; Syntax error reading source at (REPL:222:16).
; Metadata can only be applied to IMetas
clj꞉neuralnet.gdl꞉> 
(symbol "foo^bar")
foo^bar

Lars Nilsson 2021-01-03T21:11:20.157100Z

So I guess the question may need clarification if you mean any symbol (including constructed from strings), or just those typed in code.

2021-01-03T23:47:27.161200Z

i think @chamaeleon makes good points. i suspect @pez meant in source code. the reader page linked has traditionally not been quite complete (gradually improving over time), but the examples above i think answer the question. fwiw, in this particular tree-sitter-clojure, i went with not allowing ^: https://github.com/sogaiu/tree-sitter-clojure/blob/master/grammar.js#L182-L187 i think parcera also doesn't allow ^: https://github.com/carocad/parcera/blob/master/src/Clojure.g4#L244