Keyboard shortcuts support
For accessibility and power-users both, we should always think about keyboard support. This was first brought up in #61, but deserves being fleshed out more.
The editor already has keyboard support for most formatting controls, including the "Paragraph" type switcher, which we are pondering moving to the side. Though since this will likely expand a fair bit beyond paragraphs, headings and preformatted, maybe that needs love too.
Many of these are existing keyboard shortcuts that should probably stay intact for back compat.
Inline formatting:
- [x] Bold
⌘B - [x] Italic
⌘I - [x] Link/edit link
⌘K(or paste around selected text) Being handled in #4411. - [x] Unlink
^⌥SBeing handled in #4411. - [x] Strikethrough
^⌥DBeing handled in #4411. - [x] Change heading size
^⌥↑for increase,^⌥↓for decrease See https://github.com/WordPress/gutenberg/issues/71#issuecomment-357252369.
Hidden (?) controls:
- [x] Undo
⌘Z - [x] Redo
⌘Y - [x] Cut
⌘X - [x] Copy
⌘C - [x] Paste
⌘V - [x] Select All
⌘ASee #4369 now. - [x] Keyboard shortcuts cheat sheet — currently
^⌥H, should it instead/also beShift ? - [x] Underline
⌘U - [x] Code
^⌥XBeing handled in #4411. - [ ] Align center
^⌥C - [ ] Align left
^⌥L - [ ] Align right
^⌥R - [ ] Justify
^⌥J - [ ] Bullets
^⌥U - [ ] Ordered list
^⌥O - [x] Remove link
^⌥SBeing handled in #4411. - [ ] ⌘+ENTER (Ctrl+Enter for Windows) to create a separator
Markdown-esque shortcuts/syntactic sugar:
- [x] Code: wrap text in backticks,
` - [x] Bullets:
*or-on newline - [x] Ordered list:
1.or1)on newline - [x] Blockquote:
>on newline - [x] H2-H6:
##-######on newline - [ ] Horizontal line:
---on newline
Insertion/block level controls:
- [ ] Insert block:
^⌥M(for fallback) and/on newline (see #24) - [ ] Move block up
^⌥↑ - [ ] Move block down
^⌥↓ - [ ] Open block type switcher
⌘~then↑/↓andEnterfor select - [ ] Toggle between block types
~
Inserter:
- [ ] Invoked where the cursor is, by typing
/on newline or pressing^⌥M, then↑/↓andEnterfor select
These two:
- [ ] Open block type switcher
⌘~then↑/↓and Enter for select - [ ] Toggle between block types
~
probably need the most discussion, as getting these right can potentially make for a killer feeling while writing.
Imagine this: type type type, churn out a blogpost, / on a newline, arrow down to image, enter, pick image with arrowkeys, enter to insert, write another line, press ~ twice to instantly switch it through heading and then to blockquote. Done.
In this situation, simply pressing ~ while inside a block switches it to the next compatible blocktype, so a paragraph would cycle over heading then to quote, whereas a gallery might cycle between gallery types. ⌘~ would actually open the switcher list so you could see the compatible blocktypes and pick one using arrowkeys.
Quip has this shortcut, worth trying out. But they use backtick `, which we are using in a markdown-esque way for code.
Important also to think of international keyboards. On US keyboards, the ~ character is in the top left, which makes it a sweet deal, easily accessible, whereas euro keyboards put the tilde under ⌥^, which is a fair bit more cumbersome. Any other ideas?
This one also deserves lots of thought:
- [ ] Change heading size
^⌥↑for increase,^⌥↓for decrease
For context, these shortcuts assume that a "Heading" is a single block type, and the heading size is a block-level property of that style. Mockup:

👆 Note, that mockup has a different style of block level controls than the UI prototype currently has.
So the flow would be:
- write text
- press
~to switch to next compatible block type, i.e. Heading — this would convert the paragraph to ah1(orh2?) - press
^⌥↓to convert theh1to ah2
Worth reminding some of these keys are not available on all the keyboard layout, for example ~.
I can look into part of this together with the other text shortcuts, and where it touches Editable.
I think it would be nice to include keyboard shortcuts for the most used blocks. As it would be a quicker way to add the blocks one use over and over again. Perhaps even have a mention of the shortcut beside the most used blocks similar to various program list shortcuts.
I've been thinking about the benefits of being able to write an article completely from the keyboard, without using a mouse. This has serious benefits for accessibility as well as for staying in the flow (kind of like when using Markdown and you can just keep writing while adding in quick formatting)
The ideal flow here could go like:
- Start typing a few paragraphs
- Type shortcut to open picker
- Start typing “
qu…” and have the quote block pop into view on the inserter and be highlighted as the number one result (https://github.com/WordPress/gutenberg/issues/1064) - Press
return/enteron the keyboard and have the block insert into the editor - Write your quote
- Press tab
- Write your citation
- Press enter twice
- Continue typing
Love those thoughts, @jwold, so much so that it was planned for a long time to use /, like Slack and IRC, to invoke a searchable block selector dialog. See https://github.com/WordPress/gutenberg/issues/323#issuecomment-297750766 for full mockups.
This is a feature I'd like to resurface, but we've punted for now as it isn't critical to V1.
Awesome! Would love to have this revisited in the future. Agreed that it isn't needed for a V1 launch though.
One keyboard shortcut request:
- [ ] ⌘/ctrl + s to save changes.
It works fine with the existing editor and I miss it on Gutenberg.
- Link/edit link
⌘K(or paste around selected text)
Yes please, this is something that I miss from the old editor.
@jasmussen What is left here? :) I'll go through your list and erase items that have been done.
Also, what does ^ and ⌥ mean?
Mac shortcuts for control and option/alt, respectively.
On my keyboard, option and alt are the some buttons. Also, from googling its seems ⌥ is option?
Yeah I think I meant ^ to mean Ctrl (the Mac version).
Also, I'll go through this list tomorrow! Thank you!
For some of these, it might be best to follow hat core does now (different for Mac and windows): https://github.com/WordPress/wordpress-develop/blob/186f963c34e64aba15294e1416a598533809ba21/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js#L235
@iseulde
What is left here? :) I'll go through your list and erase items that have been done.
Wow, amazing progress. This is coming together!
Wanted to add notes on these:
Insertion/block level controls: Insert block: ^⌥M (for fallback) and / on newline (see #24) Move block up ^⌥ Move block down ^⌥ Open block type switcher ⌘~ then ↑/↓ and Enter for select Toggle between block types ~
Inserter Invoked where the cursor is, by typing / on newline or pressing ^⌥M, then ↑/↓ and Enter for select
These are suggestions, and they are so old now that they might very well not be relevant anymore. It's totally fine in implementation to decide that a different shortcut makes more sense.
For example, I think ⌘+Shift+↑/↓ might be better for moving blocks:

Just to note that some of the keys suggested here are not available on some non-English keyboard layouts. For example, there's no tilde character in many keyboard layouts:
Open block type switcher ⌘~ then ↑/↓ and Enter for select Toggle between block types ~
These won't work universally. Considering also #3218 I'd tend to think the only way to make shortcuts available to all users, is to make them configurable.
Agree with Andrea, that particular shortcut might need to be rethought, and keeping past shortcuts in mind (in the case of the block switcher, the inspiration is the paragraph dropdown).