noteloom

Keyboard shortcuts

Wired up in one place — useEditorKeyboardShortcuts(containerRef) — at the container level, so every block gets the same behavior for free.

Formatting

ShortcutAction
Ctrl/Cmd+BToggle bold on the current selection
Ctrl/Cmd+IToggle italic
Ctrl/Cmd+UToggle underline

Mark toggling resolves a same-block selection first (one or more runs within one block), falling back to a cross-block resolver for a selection spanning sibling blocks. A selection spanning non-sibling blocks (different nesting depths) isn't supported.

History

ShortcutAction
Ctrl/Cmd+ZUndo
Ctrl/Cmd+Shift+Z or Ctrl/Cmd+YRedo

Undo/redo are no-ops if your store is a plain EditorStore rather than wrapped in History.

Selection

Ctrl/Cmd+A is two-stage, matching Notion/Google Docs: the first press uses the browser's native select-all within the focused block (no code needed). Pressing it again while the whole current block is already selected promotes to a custom "whole document selected" state — browsers don't reliably support a script-constructed selection spanning multiple independent contentEditable regions, which is exactly why this editor uses one region per block in the first place.

While the whole document is selected this way: Backspace/Delete clears it (falling back to one blank paragraph), typing a printable character replaces it with that character, Escape or any other key cancels the mode, and Ctrl/Cmd+C/Ctrl/Cmd+X copy/cut it via the same clipboard handlers as an ordinary selection.

Structure & navigation

ShortcutAction
EnterSplit the current block at the caret (behavior varies by block type — see each block's own doc page)
Backspace at start of blockMerge into the previous block, or delete it if empty
Tab / Shift+TabIndent / un-indent a list item or toggle heading
/ Move focus to the adjacent block
Backspace/Delete on a selected contentless blockA divider/embed/etc. selects on the first press, deletes on the second — same two-stage convention as Notion
KeyOpens
/Block menu (insert any block, or a select/date/checkbox inline widget)
@Mention/field menu — only for inline types that opted in with triggers: ['at']
:Emoji picker

Inside any of these menus: / to move, Enter to select, Escape to close.