Skip to main content
CODEMUXManual

File Editor

Built-in CodeMirror 6 editor for quick file edits with syntax highlighting, dirty tracking, and markdown preview.

Codemux includes a built-in file editor for quick edits and reviews without leaving the app. It's not a full IDE — it's for fast changes, reading code, and reviewing files alongside your terminal and diff views.

Opening Files

Files open in editor tabs from several places:

  • File tree panel — Click any file in the sidebar file tree
  • File search — Ctrl+Shift+P to fuzzy-search filenames, Enter to open
  • Content search — Ctrl+Shift+F to search file contents; picking a result opens the file scrolled to that line with the match selected
  • Terminal — Ctrl+click a path:line reference in terminal output
  • Diff viewer — Click the pencil icon in the diff toolbar to edit the current file

With nothing typed, file search lists the files already open in the editor and the files changed in git. Content search has Match case and regular expression toggles (Alt+C / Alt+R); an invalid pattern shows its error instead of "No results". Both dialogs highlight the matched text, and a list that hits its result cap ends with "Showing the first N" so you know to narrow the query.

If the file is already open in another tab, Codemux activates that tab instead of opening a duplicate.

Language Support

Syntax highlighting is provided via CodeMirror 6 language extensions. Supported languages:

LanguageExtensions
JavaScript.js, .mjs, .cjs
TypeScript.ts
JSX.jsx
TSX.tsx
Rust.rs
Python.py
Go.go
HTML.html, .htm, .svelte, .vue
CSS.css, .scss, .less
JSON.json, .jsonc
Markdown.md, .mdx
YAML.yaml, .yml

Languages are lazy-loaded — only the extension for the current file is fetched. Files with unrecognized extensions open without highlighting.

Images open in a dedicated viewer — .png, .jpg, .jpeg, .gif, .bmp, .ico, .webp, .avif, and .svg render in an image pane rather than the text editor. Videos play — .mp4, .m4v, .webm, .mov, .ogv, .mkv, and .avi open in a video player with the usual controls. Other binary files (fonts, archives, compiled binaries, audio, PDFs) are detected and blocked with a "Binary file — cannot edit" message.

Editing and Saving

The editor includes line numbers, bracket matching, active line highlighting, search (Ctrl+F), multi-cursor support, and line wrapping.

Saving: Press Ctrl+S to write changes to disk. A brief Saved chip confirms it; a failed save shows an error toast instead.

Dirty tracking: When you have unsaved changes, two indicators appear:

  • A dot next to the filename in the editor toolbar, with a "Ctrl+S to save" hint
  • A dot on the tab, in the title-bar tabs or the classic tab bar

Both clear when you save. The dirty state is tracked by comparing the current content against the last-saved baseline.

Files Changed on Disk

Agents edit files while you have them open, so an open file keeps watching its copy on disk — every 2 seconds, and whenever the window regains focus.

  • No unsaved edits — the file reloads in place, keeping your cursor and scroll position, and a brief Reloaded from disk chip appears.
  • Unsaved edits — your buffer is left alone and a bar appears: "Changed on disk. Your edits are unsaved." Reload takes the version on disk (one Ctrl+Z brings your edits back); Keep mine keeps your edits, and your next save replaces the file.

A save never overwrites newer content silently: Ctrl+S checks the disk first, and if the file changed it shows the same bar and writes nothing. Ctrl+S does nothing while the bar is showing. Reloads from disk stay out of the undo history, so Ctrl+Z can't undo an agent's edit or empty a freshly opened file.

Markdown Preview

Markdown files (.md, .mdx) open in rendered mode by default — a styled HTML preview with GitHub Flavored Markdown support (tables, checkboxes, strikethrough).

Toggle between views using the Rendered and Raw buttons in the toolbar. Raw mode shows the standard CodeMirror editor with markdown syntax highlighting.

Changes made in raw mode are reflected when you switch back to rendered view.

Theming

The editor theme syncs with the rest of Codemux. Syntax highlighting colors are derived from the system ANSI palette, so the editor matches your terminal. Font is JetBrains Mono at 13px.

Limitations

  • Not a replacement for a full editor — no extensions, no LSP, no integrated terminal
  • Maximum file size: 2 MB
  • No multi-file editing features (find-and-replace across files, etc.)
  • Cursor position and scroll offset are not persisted across restarts (open editor tabs and their file paths do survive a restart)