I am unsure what the command calva.toggleKeybindingsEnabled
. It seems to be a way to add custom keybindings? Is that right?
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.
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 😆
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.
It disables/enables basically all Calva keybindings
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
Several times in a work session, so they contributed this command
Ah, I did see something in the docs about that, just didnt make the connection to the command name. Thanks.
No prob
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/920 • https://github.com/BetterThanTomorrow/calva/issues/922 • https://github.com/BetterThanTomorrow/calva/issues/923 • https://github.com/BetterThanTomorrow/calva/issues/923 • https://github.com/BetterThanTomorrow/calva/issues/923 • https://github.com/BetterThanTomorrow/calva/issues/923`ctrl+alt+c n`
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!
To be clear, I want: (func-2 (func a b)) But I cannot type this. Calva allows me (func-2) (func a b).
Take a look at the paredit docs:
https://calva.io/paredit/
slurp forward
in particular
Ok, thanks to @pavlos and playing with settings.json I found out you can disable paredit by adding
"calva.paredit.defaultKeyMap": "none",
Thanks.
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 😛
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
barriers to clojureworld are high enough for me. (The language is the smallest part in this.) But I appreciate your concerns.
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/
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.
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))
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:
Nice, @jr0cket! A note about the toggleKeybidings command. It is not deprecrated. We just stopped providing a default shortcut for it.
I think it is a big mistake to disable paredit, but whatever floats your boat!
@ajoberstar Thanks for the sponsorship! ❤️ :calva:
Mind if we put you under the sponsors section of the readme?
You're welcome to add me there. Glad to support the Clojure tooling community!
Yes, thanks, @ajoberstar! Wonderful that you find Calva worth sponsoring!
Does anyone know if ^
is used in symbol names anywhere? @sogaiu?
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.However
(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
So I guess the question may need clarification if you mean any symbol (including constructed from strings), or just those typed in code.
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