Editing Modes
Opal supports two primary editing modes for markdown files:- Rich Text Mode
- Source Mode
The rich-text editor provides a WYSIWYG (What You See Is What You Get) experience powered by MDXEditor. It includes:
- Live preview of formatted content
- Toolbar with formatting controls
- Inline image handling
- Table editing
- Code block syntax highlighting
- Admonitions (callouts)
Switching Between Modes
You can switch between editing modes at any time:Use the keyboard shortcut
Press
Cmd + ; (Mac) or Ctrl + ; (Windows/Linux) to toggle between rich text and source modeSource mode is automatically activated when git conflicts are detected in a file
Editor Features
Rich Text Editor
The rich-text editor includes these formatting tools:- Headings: H1 through H4 levels
- Lists: Ordered and unordered lists
- Links: Insert and edit hyperlinks
- Images: Upload and embed images
- Tables: Create and edit markdown tables
- Code blocks: Insert fenced code blocks with language selection
- Quotes: Block quotes for emphasis
- Thematic breaks: Horizontal rules
- Search: Find and replace text within the document
Source Editor
Supported File Types
Supported File Types
The source editor provides syntax highlighting for:
- Markdown (
.md,.mdx) - JavaScript/TypeScript (
.js,.ts,.tsx) - CSS (
.css) - HTML (
.html) - JSON (
.json) - EJS templates (
.ejs,.eta) - Mustache templates (
.mustache) - Nunjucks templates (
.njk,.nunjucks) - Liquid templates (
.liquid)
Editor Preferences
Editor Preferences
Customize your editing experience with these options (available in the toolbar):
- Spellcheck: Toggle browser spellchecking
- Vim Mode: Enable vim keybindings (source mode only)
- Git Conflict Resolution: Enable/disable the conflict resolution UI
Keyboard Shortcuts
Access the full keyboard shortcuts reference by pressing
Cmd + K (Mac) or Ctrl + K (Windows/Linux)| Action | Mac | Windows/Linux |
|---|---|---|
| Focus editor | Cmd + E | Ctrl + E |
| Toggle source/rich | Cmd + ; | Ctrl + ; |
| Exit editor | Esc Esc | Esc Esc |
| Save (auto) | Automatic | Automatic |
Edit History
Opal automatically tracks your edit history for main files:Working with Images
Images are automatically optimized when you upload them:- Upload: Drag and drop images into the editor or use the image toolbar button
- Optimization: Images are automatically compressed and converted to web-friendly formats
- Thumbnails: Thumbnails are generated for quick preview in the file tree
- References: Image paths are automatically updated when you move or rename files
Live Preview
While editing markdown, CSS, or HTML files, you can view a live preview:- Click the Preview button in the toolbar to open the live preview pane
- The preview updates as you type (debounced for performance)
- Preview supports scroll synchronization with the editor
- Works with both rich text and source modes
Auto-Save
All changes are automatically saved:- Edits are debounced (saved after you stop typing)
- No manual save action required
- Save status is indicated in the UI
- Changes persist immediately to the workspace storage