Fork me on GitHub
#calva
<
2021-01-03
>
practicalli-johnny02:01:28

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

bringe02:01:22

It disables/enables basically all Calva keybindings

bringe02:01:00

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

bringe02:01:12

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

practicalli-johnny02:01:28

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

pez10:01:52

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-johnny11:01:10

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 😆

pez11:01:53

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.

pez14:01:08

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`

🎉 6
calva 12
bastilla14:01:20

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!

bastilla14:01:19

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

pavlosmelissinos14:01:39

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

pez15:01:20

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/

pez16:01:40

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.

pavlosmelissinos16:01:18

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 @U01BEC6NUSY 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))

pez16:01:27

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:

👍 3
🙏 3
bastilla15:01:35

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

pavlosmelissinos15:01:18

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 😛

bastilla15:01:47

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

👍 6
pez17:01:31

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

practicalli-johnny15:01:51

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

calva 3
pez16:01:34

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

bringe19:01:58

@ajoberstar Thanks for the sponsorship! ❤️ calva

bringe19:01:58

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

ajoberstar19:01:21

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

👍 3
pez19:01:26

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

pez20:01:03

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

Lars Nilsson21:01:00

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 Nilsson21:01:44

(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 Nilsson21:01:20

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

sogaiu23:01:27

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