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

Making minor modes (and their menus) fully customizable. #9829

Closed
7ombie opened this issue Mar 7, 2024 · 5 comments
Closed

Making minor modes (and their menus) fully customizable. #9829

7ombie opened this issue Mar 7, 2024 · 5 comments
Labels
A-helix-term Area: Helix term improvements C-enhancement Category: Improvements

Comments

@7ombie
Copy link
Contributor

7ombie commented Mar 7, 2024

As an enduser, if you attempt to customize the existing minor modes, you quickly run into a number of limitations which prevent you from producing menus that function like the built in menus. Trying to create new minor modes is even more limiting.

Rather than preemptively open half a dozen issues, it seemed better to open one general issue to establish what needs doing, and separate issues can be opened later, if required:

  • There's no way to assign new titles (Match, Space etc) to existing menus.
  • There's no way to assign titles to new menus.
  • Commands that are added to menus do not infer their descriptions (from those used by Command Palette).
  • There's no way to add/edit the descriptions used by commands within a menu.
  • The order of the commands within a given menu cannot be set or described (alphanumerical, descending etc) by the user.

There's also #9814 (some minor-mode-commands have no names, so cannot be rebound), but that's already an open issue.

@7ombie 7ombie added the C-enhancement Category: Improvements label Mar 7, 2024
@7ombie
Copy link
Contributor Author

7ombie commented Mar 7, 2024

It would be nice if we could arbitrarily define a menu's content with a block of text (multiline string or a separate file or whatever). The format would be simple: The first line is the title, and the remaining lines form the body. The width would be inferred as the length of the longest line, while the height would be inferred from the number of lines.

For example, the user could provide something like this (via their configuration):

New Menu
o Open the thing
O Open the thing, then do another
  thing, with a hard break to preserve
  the desired line width
d Do the thing 

Helix would basically just add the decoration around the outside.

I don't think much more is required. There are other features that'd be nice to have, like inferring menu descriptions from the Command Palette entries (when the user doesn't define their own menu content), but they'd be pure conveniences, if you can always just make your own menus. This leaves #9814 open, but it addresses all of the bullet points (with the freedom to do other things as well).

We'd need some way to associate a menu with a given prefix, something like:

[keys.normal.a]
menutext = "..."
[keys.normal.a.b]
menutext = "..."

@kirawi
Copy link
Member

kirawi commented Mar 7, 2024

The descriptions are covered by #1474

@kirawi kirawi added the A-helix-term Area: Helix term improvements label Mar 9, 2024
@7ombie
Copy link
Contributor Author

7ombie commented Mar 10, 2024

What does #1474 do that couldn't be achieved with a simple block of text? An arbitrary block of text solves other problems too. To be honest, #1474 just seems complicated and limited at the same time.

@kirawi
Copy link
Member

kirawi commented Mar 10, 2024

Sorry, that was the wrong issue. It's actually #1752

@7ombie
Copy link
Contributor Author

7ombie commented Mar 11, 2024

Cool. No worries, @kirawi. Thanks for correcting that.

You're right (#1752 does cover descriptions), and there are a bunch of other issues that #1752 links to that roughly cover the bullet-points above.

I'm not sure (I'm literally 50/50) whether there's any merit in summarizing a bunch of open, related issues in a separate issue, just to look at more general solutions. In any case, it's probably not my place to do that here, and this issue doesn't really achieve that very well anyway.

Thanks for your time and patience, @kirawi. Much appreciated.

BTW - I've been heavily customizing Helix recently, and ran into a few issues I wanted to address. That was a blip - I'm not looking to constantly spam the issue tracker.

@7ombie 7ombie closed this as completed Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-enhancement Category: Improvements
Projects
None yet
Development

No branches or pull requests

2 participants