Documentation Index
Fetch the complete documentation index at: https://mintlify.com/euclidesseg/euclides-workspace/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Keymaps define keyboard shortcuts that trigger commands in the Euclides Rich Editor. The editor uses a layered keymap system where custom shortcuts take precedence over base shortcuts.buildEuclidesKeymap()
Creates the custom keymap plugin for Euclides Editor.Signature
Parameters
schema(Schema): The editor schema used to access node and mark types
Returns
Plugin: A ProseMirror keymap plugin
Keyboard Shortcuts
Implementation
Available Key Bindings
| Shortcut | Command | Description |
|---|---|---|
Mod-b | toggleMark(strong) | Toggle bold formatting |
Mod-i | toggleMark(em) | Toggle italic formatting |
Mod-z | undo | Undo last change |
Mod-y | redo | Redo last undone change |
Shift-Mod-z | redo | Redo (Mac-style shortcut) |
Shift-Enter | cmd (hard break) | Insert line break |
Enter | splitListItem | Create new list item |
Shift-Ctrl-c | setBlockType(code_block) | Convert to code block |
Modifier Key: “Mod”
The"Mod" prefix is a cross-platform modifier:
- Windows/Linux:
Ctrl - Mac:
Cmd
Command Details
Text Formatting
Bold (Mod-b)
strong mark on the current selection.
Italic (Mod-i)
em mark on the current selection.
History Commands
Undo (Mod-z)
Mod-y or Shift-Mod-z)
Mod-y: Windows/Linux styleShift-Mod-z: Mac style
Line Breaks
Hard Break (Shift-Enter)
<br>) within a paragraph, useful for creating line breaks inside list items without starting a new list item.
List Operations
Split List Item (Enter)
- Creates a new list item
- Moves cursor to the new item
- Preserves list structure
Block Type Conversion
Code Block (Shift-Ctrl-c)
Keymap Configuration
The keymap system works in layers:- Euclides Keymap (highest priority)
- Base Keymap (fallback)
- The editor checks Euclides keymap first
- If no match, it falls back to base keymap
- If still no match, default browser behavior occurs
buildEuclidesKeymap() is registered before keymap(baseKeymap) in the plugin list:
Source Reference
Location:~/workspace/source/projects/euclides-rich-editor/src/lib/engine/keymaps/euclides-keymaps.ts