Fork me on GitHub

@gerred thanks! I love to hear that. My comment was about how developing Calva is not something that brings food to the table, mainly acknowledging that I understood why @brandon.ringe needed to do ”real” work. Your encouragement would fit perfectly as a review on the extension marketplace, btw. It is so concrete and wonderful.


👍 also, I should expand upon the first bit of that comment, setup a way for me to sponsor and I'll put some financial support to it. at least the amount I pay cursive each year, would love to enable the time to develop this more in ways that don't necessarily (out of time) mean contributing code or ideas

👍 4

I will consider this. There probably should at least be a way, as you say.


Oh, you had updated the PR @slack1038! I don't get e-mail notifications about such events, maybe that is a setting... Anyway, until I know if I can fix that, please poke me about such amends. 😃


Oh okay 😂


I'm not used with people fixing things immediately, haha. It's more common that people say they will do something and then it never happens, sadly. But now, I sound like the grumpy old man I am. I'm super happy that we are fixing this powershell business. Issues like this show how important it is:


Hi @pez, I’m trying out the experimental setting to align map items in columns. It works just fine mostly, except for this case:

(defn extract-relevant-fields [metric-dict]
  {(keyword (:metric metric-dict)) (or (:value metric-dict) (:value (first (:periods metric-dict))))})
Because of the line length, I’d like to put the key and the value on two separate lines, but Calva won’t let me:
(defn extract-relevant-fields [metric-dict]
  {(keyword (:metric metric-dict)) 
   (or (:value metric-dict) (:value (first (:periods metric-dict))))})
What’s your take on this?


@stefan.van.den.oord I'd welcome an issue about this on the repo. I certainly see the issue. Calva is currently using an old patch for clj-fmt that had this alignment. I think there has been progress in improving that on master since. Not sure it supports your use case here anyway though, clj-fmt tends to be quite gentle with its reformatting. But if you have some time, please look at the PRs (opened and closed) regarding alignment on the clj-fmt repo. And let me know if you think it is time I rebase my stuff. And if it does not yet support your use case, we'll have a look if we can support it by some other means.


Sure @pez, I’ll have a look at it (probably not today though)!

metal 4

channel: I have published a new version of Calva, 2.0.12 with the most important change being that jack-in should now work for Windows 10. There are also some other changes, maybe @lspector will like the way the output is now printed to Calva says.

👍 4
aw_yeah 4

@brandon.ringe: you might want to merge in upstream/master on your fork. I just made a change to how stdout is printed that might effect your experiment. It's probably easy to fix with a conditional check for any value in the message, but I'm not sure.

👍 4

is there parinfer support today via calva? I noticed the vscode one is on hold to focus on atom parinfer


There is only limited support. In Calva you use tab to format the current enclosing form based on parens, and you use ctrl+alt+p to infer parens based on indentation. To compensate some for the loss of autostructure you get with parinfer proper, the paredit slurp and barf forward commands have easy accessible keyboard shortcuts: ctrl+right and ctrl+left, respectively.


And the reason the vscode parinfer extension is on hold is not really to focus on Atom. It is because vscode does not really have the APIs that parinfer needs, making it really hard/impossible to implement. Especially smart mode.


That’s too bad 😞 Smart mode is very exciting.


Yeah, it is lovely!


that makes sense. I was going off of the notice in the description, good to know it's that so I don't try to add one.


What notice in what description? 😃


Ah, I think I got it now. About why Parinfer for vscode is on the backburner?


If you do decide to take a look at it @gerred, I'd be happy to have a Hangout session together and we can discuss how the situation can be improved.


Calva-friends: Here's another getting started-ish page on the wiki that I'd like help with. You can edit it or just suggest things or whatever:


On getting started, fwiw I find the key chords confusing myself and confusing to students in part because there's no "alt" on my/our mac keyboards, and I always forget what the translation is. I find it better to use/recommend command-shift-p to bring up the command palette, and then type/select the command you want. And the only explicit command advice I have on my recommendations to students is "Two key commands that enable my workflow are Calva: Start a project REPL and connect (a.k.a. Jack-In) and Calva: Send current expression (or selection) to REPL window and evaluate it." I called these the "keys to the castle" above because with them (and tab for auto-reindentation) I'm in business, can do everything I want, and can discover other stuff later if I want it, while without these things I'd be lost.


alt is option on Mac. Even says both on my Mac keyboard. But I could add a mention about that somewhere.


Ah -- thanks -- I hope I remember that! Mine says option and has an icon that is sort of a backslash with serifs and a floating bar... FWIW I also just find it hard to remember key chords (although a handful from emacs are burned in my brain), and I think they're a real turn off for many students if they're new to computer science. Menu items or commands that show up in the palette are less demanding on memory and have a better learning curve. It's great that all of the Calva commands show up in the palette when typing "Calva:" there, and that's a great selling point (that maybe should be stated more prominently? Not sure -- maybe this is already pretty clear). But FWIW my perspective is that it'd be best to mention full commands rather than (or in addition to) key chords, especially in "getting started" docs. Once people know a command and realize that they want to use it a lot then they'll see that there's also a key chord and maybe bother to learn it.


There is a page on the wiki now about finding Calva commands. I added it the other day as a way to take care of your feedback. Please check it out and let me know if you think it's any good.


I know what symbol you are taking about for the option key. But on my Mac it looks like so.


Got it. But actually, it turns out that I'm having problems with the key commands aside from the key labeling. Weird and bad ones. Maybe I'm doing something wrong. If I jack in and type (+ 1 2) in the editor and highlight it, then command-shift-p brings up the command palette and selecting Calva: Send current form to REPL window and evaluate it reliably sends the form to the REPL window and prints the result (3). Exactly like I want. However, if I highlight the form and press control-option-c, release, and then press option-e, then most of the times it just replaces (+ 1 2) with a back-tick and sends nothing to the REPL window. On two occasions, though, it sent the form to the REPL window, evaluated it (printing 3), but also replaced the form in the editor with a back-tick and also somehow locked the editor window so that nothing I typed in it changed anything! I was only able to regain editing control by quitting and restarting VS Code. Bizarre. Any ideas?


The "Finding Calva Commands and Shortcuts" page looks great!

aw_yeah 4

There is a bug in vscode with “dead“ keys acting weird in keyboard shortcuts. I am guessing option-e is a dead key on your keyboard. Change the shortcut to something else to make it work. That vscode also locks up like that was news me, though...


Huh... is "deadness" a hardware thing? This is a pretty new machine...


Oh, and dead key means a key that doesn't immediately produce output, and instead waits for a second key to be pressed. So option-e on your keyboard probably yours stuff like è if you press it followed by e.


Ah... so it's interacting with some other configuration in my system? I think I will just stick to using (and recommending) commands selected in the palette, especially since changing the shortcut will make the memory demands and learning curve even worse and weirder.


Your choice. 😀. The command palette will show whatever you change it to though.


That's nice. But if I change it then I'll still be out of sync with the docs, and with what students have to do unless they make the same changes etc. At least in my context sticking with the palette seems best by far. And my suggestion for docs is to always keep the command names and palette in mind as a first-class mode of interaction, without assuming that people will be using the key chords.


I ran into the same thing recently, that’s why I wrote the above wiki page. So I guess I documented an alternative to OPTION-e 🙂

❤️ 4
👍 4

Are you both Americans, @lspector and @stefan.van.den.oord ?


If this is a thing with American keyboards we should consider changing the default.


No, Dutch :flag-ye:


I’ve seen it on multiple keyboard layouts; IIRC Dutch, (international variants of) US, ABC, ...


If you decide to change it, I think the shortcut I proposed is probably safe & convenient...


Yes. I'll change it to that. Do we know of any other Calva default that is problematic?


@pez I didn’t encounter anything so far. Do you have a (complete) keybindings cheat-sheet somewhere? I could quickly review it that way. Having that a4-printable would be very convenient by the way I think for new users…


I should have. But the package.json should take you far.


Ok I’ll check.


If you know how that A4 should look, that would be truly awesome.


Or Letter size. Not to confuse @lspector's students. 😍


Sure 🙂 Maybe something like this?


Auto-generating it would be the best way of course.


I still remember printing out a cheat sheet like that for CIDER and smiling foolishly every time I looked at it, taped to my desk beside my keyboard.


Hehe I had the relevant part of the Calva paredit README on my desk, both at work and at home 🙂

calva 4

I'm trying to edit Joker (i.e., '.joke') files as if they were .clj files. Is there a way to tell Calva to treat the .joke files as Clojure files?


On the buttom right there is something like what File Type is currently open You just can click on it and change it to clojure :)