Fork me on GitHub
#calva
<
2019-07-18
>
cheatex06:07:24

@pez Yep, Alt+Delete/Backspace works. But these are hard to guess and it is not consistent with editor behavior. May be it would be better to let Del do the same delete thing as in editor and leave fancy paredit thing for Alt+Del?

👍 4
pez08:07:46

That is a matter of preference. Which is why Calva makes it configurable, defaulting to non-strict mode, even. Because reasons the REPL window does not adhere to the configuration yet, though. So I mentioned the alt+backspace workaround for you to be able to delete those extra ) until someone fixes the problem in the REPL window. Extraneous ) being inserted is a bug, btw.

pez08:07:11

@lspector, that's a bug in vscode. It doesn't do never when you say never. You need to configure it in settings.json under the "[clojure]": key. Just enter that key and you should get all the Clojure defaults inserted by vscode. But in case that does not happen, here they are:

"[clojure]": {
        "editor.wordSeparators": "\t ()\"':,;~@#$%^&{}[]`",
        "editor.autoClosingBrackets": "always",
        "editor.autoClosingQuotes": "always",
        "editor.formatOnType": true,
        "editor.autoIndent": true,
        "editor.formatOnPaste": true,
        "files.trimTrailingWhitespace": false,
        "editor.matchBrackets": false
    }

lspector09:07:16

Ooo good to know. I'll try it. Not sure whether it's better just to tell students to live with working around auto-typed stuff or that the platform is buggy and they have to find and edit a configuration file, but I will mull that after seeing if I can get it working myself.

pez09:07:21

Autoinserting matching brackets is quite common in editors of today. Telling people to switch it off seems odd, IMO.

lspector09:07:30

I agree it's a common mistake 🙂

lspector10:07:58

Many seasoned programmers, including the people who write the tools, think it's a great thing, and I'm sure it's great for them. But as a programming teacher for several decades I'm pretty confident in saying it's an unnecessary barrier and inconvenience for many beginners, and it also happens to be a nuisance to me personally as a Lisp programmer for... jeez... something like 35 years... oy. Anyway, I hear you but I would still love to turn it off, and to make it easy for my students to do so as well.

pez10:07:44

I would tell them to follow the Tao of the editor instead of fighting it. 😃

lspector10:07:09

Possibly, after learning to program and learning Clojure, etc. But I don't want to make them learn and follow any new Tao before that. And I myself sometimes have to cut/paste to a plain text editor, edit, then cut/paste back, since the editor's Tao and mine just aren't the same, and that feels really silly. FWIW I do a lot of editing of parts of expressions out of order, cutting/pasting expressions, etc., just because that's the way my thinking and typing interact. I find auto-reindenting to be essential (especially on partial/incomplete expressions, which seems to be getting better in Calva), but auto-insertion of brackets to range from inconvenient to infuriating depending on the situation. And it's best not to trigger my parinfer rants 😱 (although yes, I acknowledge that it is very clever)

👍 4
cheatex10:07:02

@pez so now REPL just has shortcuts independent from main editor? Is there an issue for that?

cheatex10:07:02

What's the name of strict/non-strict mode config param? I can't find where I've set it for editor.

pez10:07:08

@cheatex Not sure if there is an issue for it. @slipset was about to create one, I think. And I don't think it is general. At least for me I get the same shortcuts in the REPL as I configure in the editor, for the shortcuts I use.

pez10:07:00

Paredit strict mode is selected using the calva.paredit.defaultKeyMap setting. One of the key maps is named strict.

cheatex11:07:14

Put it differently, should I open a new issue for REPL having different keybindings than editor? Or it already exists and I can subscribe to follow the progress.

pez11:07:19

Check if it exists and otherwise create it?

pez11:07:59

Please add detailed repro steps.

lspector21:07:41

Maybe focusing on my own editing style isn't helpful, but I think it's worth considering beginning programming students. Particularly if they're not yet at all sure programming is for them, maybe because they're from a group that's underrepresented in the field, their preexisting typing skills may be the one firm piece of ground in a sea of intimidating weirdness. Having to learn a new way to type or to fight with an editor to make the text be what they think it should be can be really discouraging and counterproductive in ways that are probably hard to appreciate for people who are already confident programmers.