Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "Cycle collection kind" command #2464

Open
gerdint opened this issue Mar 25, 2024 · 6 comments
Open

Add "Cycle collection kind" command #2464

gerdint opened this issue Mar 25, 2024 · 6 comments
Labels
paredit Paredit and structural editing

Comments

@gerdint
Copy link
Contributor

gerdint commented Mar 25, 2024

It is often handy to change the kind of balanced brackets you are working with, i.e. (foo bar) => [foo bar].
Some Clojure editors have such a command. Typical candidates are: () => [] => {} => #{} (and then back over again).
Should work on the expression's closest enclosing brackets

@PEZ PEZ added the paredit Paredit and structural editing label Mar 25, 2024
@PEZ
Copy link
Collaborator

PEZ commented Mar 25, 2024

Would be nice. So far we have rewrap-commands, but maybe some people find it easier with a single command.

image

@gerdint
Copy link
Contributor Author

gerdint commented Mar 25, 2024

Ah, I was not aware of the rewrap commands! I actually think that may be a better option. The only (but big) upside of a single command that is that you only need to bind (and remember) a single key. What is the rationale for "H" for the set?

@PEZ
Copy link
Collaborator

PEZ commented Mar 25, 2024

Since the cycle command can be expressed in terms of these commands, I think it is reasonable easy to implement.

What is the rationale for "H" for the set?

Hash-sign 😄

@gerdint
Copy link
Contributor Author

gerdint commented Mar 26, 2024

Roger. I would perhaps prefer semantic keys, i.e 'm' for "map", 'v' fo "vector" etc, but nothing I can't tweak myself!
But I think it would make sense to use a prefix key and a single un-chorded second key (like for the ctrl-alt-space prefix for the custom repl commands), i.e: "Ctrl-alt-r p" for "Rewrap ()". Or any particular reason this is not the currently the case?

@PEZ
Copy link
Collaborator

PEZ commented Mar 26, 2024

Semantic mnemonics would have made perfect sense. Too late now, I'm afraid.

As for why not ctrl+alt+r p. Iirc, we had something else bound to that. It's also very easy to type. Hold down ctrl+alt, type r p.

@gerdint
Copy link
Contributor Author

gerdint commented Mar 27, 2024

Well, if you have an ergonomic keyboard with all modifers on your thumbs (a Kinesis advantage in my case) and a layout where 'r' and 'p' are on different hands (Dvorak layout in my case, but same for Qwerty in this case) it's less easy to type because you need to switch hands for the modifers! :) Come to think of it, that's probably why I find multi-stroke chorded key bindings onerous, unless you are lucky and there happens to be no hand-switching involved.

I understand it's hard to please everyone and that's why keybindings are customizable, but this is why something like "ctrl+alt+r p" is more convenient in my opinion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
paredit Paredit and structural editing
Projects
None yet
Development

No branches or pull requests

2 participants