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

Slash command shortcuts for different heading levels #50258

Open
cbirdsong opened this issue May 2, 2023 · 4 comments
Open

Slash command shortcuts for different heading levels #50258

cbirdsong opened this issue May 2, 2023 · 4 comments
Labels
[Block] Heading Affects the Headings Block [Type] Enhancement A suggestion for improvement.

Comments

@cbirdsong
Copy link

cbirdsong commented May 2, 2023

What problem does this address?

You can easily add a heading block by typing /he and using the autocomplete box, like so:

The text "/he" entered into the block editor, followed by a popup that shows the heading block as the first option

However, when I'm writing something and am adding a heading I usually know what heading level it should be, and if it's not an H2, I'll need to change the heading level after adding the block. To do that, I have to either:

  • take my hands off the keyboard and use the mouse to pick in the toolbar
  • do a lot of arrow key work on the keyboard

Both routes are pretty involved and make it easy to lose my train of thought.

What is your proposed solution?

Add slash command shortcuts for /h3, /h4, etc that add a heading block with that heading level preselected.

@ndiego
Copy link
Member

ndiego commented May 2, 2023

I know this is not what you are looking for, and a slash command would be great, but you can do this with markdown. For example, ### and then a space will create an h3.

@ndiego ndiego added the [Type] Enhancement A suggestion for improvement. label May 2, 2023
@cbirdsong
Copy link
Author

cbirdsong commented May 3, 2023

That trick definitely gets the job done for me, but it's not very discoverable or explainable to someone who isn't familiar with markdown.

@talldan
Copy link
Contributor

talldan commented May 3, 2023

Typing /h4 and enter does already work, it's just the autocompleter doesn't show any suggestions as there are no blocks called that.

I think there might be other issues already open for making it show something, possibly using block variations. I think the tricky part is that it wouldn't be great to flood the autocompleter with only heading block suggestions.

@cbirdsong
Copy link
Author

cbirdsong commented May 3, 2023

See, I didn't even think to try that because the "Heading" autocomplete option disappears once you add a number to /h. I think the shortcut would be a bit more discoverable if that stayed visible once you've typed /h#, even if they label stayed as just "heading".

(It would obviously be clearer if it said "Heading 3" or whatever, but I can see how that introduces a lot of potential complications)

@skorasaurus skorasaurus added the [Block] Heading Affects the Headings Block label May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Heading Affects the Headings Block [Type] Enhancement A suggestion for improvement.
4 participants