@stesura/core/keymap
stesuraKeymap(schema) is ProseMirror’s baseKeymap with these bindings added
or overridden (Mod is Cmd on macOS, Ctrl elsewhere):
| Key | Binding |
|---|---|
Enter | Opens a selected equation’s editor; otherwise a newline in code, outdent or un-number an empty list item, or split the block (applying the style’s next style at its end); where no block can be added (a narrowed schema), a line break |
Shift-Enter | A newline in code, otherwise a line break (insertHardBreak) |
F2 | Opens a selected equation’s editor |
Tab / Shift-Tab | Next / previous table cell (Tab in the last cell appends a row); outside tables, indent / outdent |
Backspace | Selects an equation before deleting it; at the start of a line, outdents an unnumbered block or removes a list item’s numbering; over a whole story (Ctrl+A), leaves one Normal paragraph |
Delete | Joins into or removes a code block from its end; removes a fully selected table; over a whole story (Ctrl+A), leaves one Normal paragraph |
ArrowLeft | Moves the caret out of a selected numbering counter |
ArrowUp | Stops the caret at the top of a section’s content instead of entering its hidden header; in later sections, jumps to the end of the previous one |
Mod-b / Mod-i / Mod-u | Toggle bold / italic / underline |
Mod-Shift-c | Toggle code |
Mod-Shift-s | Toggle strikethrough |
Mod-Shift-= / Mod-= | Toggle superscript / subscript |
Mod-z | undo |
Mod-Shift-z / Mod-y | redo |
Mod-a | Select all within the part holding the caret (content, header or footer) |
Escape | Disarms the format painter, otherwise closes search |
Mod-f | Opens search |
Mod-> / Mod-< | incrementFontSize("up") / incrementFontSize("down") |
Mod-Enter | Inserts a paragraph after the table when inside one, otherwise a page break |
Mod-l / Mod-e / Mod-r / Mod-j | setTextAlign "start" / "center" / "end" / "justify" |
Alt-t | insertTable({ rows: 3, cols: 3 }) |
Mod-k | setPendingLink |
Mod-Shift-x | toggleDirection |
Shift-F3 | cycleCase |
Ctrl-Space | clearFormatting(): character formatting only (Word’s Ctrl+Space; Ctrl on macOS too, where Cmd+Space is Spotlight) |
Ctrl-q | Paragraph formatting only, keeping the style (Word’s Ctrl+Q; Ctrl on macOS too, where Cmd+Q quits the browser) |
Functions & values
stesuraKeymap
The editor’s key bindings: ProseMirror’s baseKeymap plus Stesura’s own
handlers for Enter, Tab, Backspace, Delete and the arrow keys, and the usual
formatting, history and alignment shortcuts.
Takes the schema because the mark shortcuts resolve mark types up front.
| Name | Type | Default |
|---|---|---|
schema | Schema<any, any> |
stesuraKeymapPlugin
stesuraKeymap as a plugin.
| Name | Type | Default |
|---|---|---|
schema | Schema<any, any> |
Last updated on