Editor Overview
Code Editor Thing is built on CodeMirror 6, a powerful and extensible code editor framework. It provides a fast, feature-rich editing experience with modern editor capabilities.Core Features
The editor comes with essential features enabled by default:- Line numbers with subtle gutters
- Syntax highlighting for supported languages
- Auto-indentation and bracket matching
- Undo/redo with full history support
- Keyboard shortcuts following standard conventions
- Theme support with dynamic color schemes
Syntax Highlighting
The editor automatically detects the language based on file extension and applies appropriate syntax highlighting.Color-Coded Elements
Syntax highlighting includes:| Element | Description |
|---|---|
| Keywords | Language keywords like if, function, class |
| Strings | Text literals and string values |
| Comments | Single-line and multi-line comments (italicized) |
| Numbers | Numeric literals and booleans |
| Functions | Function names and calls |
| Variables | Variable names and identifiers |
| Types | Type annotations and class names |
| Operators | Mathematical and logical operators |
Supported Languages
Code Editor Thing supports syntax highlighting and language features for:- JavaScript & TypeScript
- Python
- Web Languages
- Other Languages
- Extensions:
.js,.jsx,.mjs,.cjs,.ts,.tsx - Features: JSX support, TypeScript syntax
- Library:
@codemirror/lang-javascript
Language Detection
The editor uses file extensions to determine the appropriate language mode:Saving Files
Save your changes using the standard keyboard shortcut:Keyboard Shortcut:
Cmd+S (macOS) or Ctrl+S (Windows/Linux)How Saving Works
When you save a file:- The editor captures the current document content
- Sends it to the Electron main process via IPC
- Writes the content to disk using Node.js file system APIs
- Confirms the save operation
Editor Configuration
The editor is configured with:- Font: Geist Mono, Fira Code, JetBrains Mono, or system monospace
- Font Size: 14px
- Line Height: 28px (content) / 21px (scrollbar)
- Padding: 12px around content area
- Tab Size: Automatic based on file type
Editor Shortcuts
Common editing shortcuts work as expected:| Shortcut | Action |
|---|---|
Cmd/Ctrl+Z | Undo |
Cmd/Ctrl+Shift+Z | Redo |
Cmd/Ctrl+S | Save file |
Cmd/Ctrl+A | Select all |
Cmd/Ctrl+C | Copy |
Cmd/Ctrl+V | Paste |
Cmd/Ctrl+X | Cut |
CodeMirror provides additional shortcuts for advanced editing. Press
F1 in the editor to see all available commands.Theme Integration
The editor dynamically adapts to your selected theme, updating:- Background and foreground colors
- Syntax highlighting colors
- Gutter appearance
- Cursor color
- Selection colors