Fork me on GitHub
Alex J Henderson09:08:05

Hi Folks, I've written a small extension for calva that I find invaluable. It closes any open parenthesis bracket and removes any whitespace around the cursor. In other Clojure IDEs I notice that when you hit ']' the cursor will move to the closing paren/bracket whether it be a ']', '}', or ')'. However in Calva I notice that you have to match the type of bracket (e.g. to close a round parenthesis '(' you have to hit ')').


Very cool that you wrote this, but I think I may be missing the point? Calva automatically adds closing parents, braces, and brackets when you type an opening one, and with paredit strict mode on (default), I can't easily accidentally delete a closer and throw things off balance. Maybe you are using Calva in some way that's not standard/default?


Yes, Calva comes with default settings for Cloiure that auto-closes brackets. And Calva Paredit helps you retain the balance. Hitting tab cleans away most whitespace around the cursor (trying to not remove the whitespace you’ve put there on purpose).

Alex J Henderson09:09:44

well I suppose tab does remove whitespace. Regarding the brackets: maybe it's my settings, but if I hit ']' to close a round brace it will insert an erroneous ']', if there's a way to make it behave like other editors (cursive/emacs) I'd love to know


Sorry for late reply. Regarding the insertion of an errornous closing bracket, I’d say that that should be fixed. It is quite annoying, even if I have become used to hitting alt+backspace when it happens to me.


An issue would be great to track this