wolfsonliu/dsh-file-explorer-preview-code

wolfsonliu★ 0JavaScriptLast synced: 2026-08-15

Open on GitHub

CodeMirror 6 code preview & editor for DSH Web — per-language syntax highlighting, in-place editing with autosave, and dark/light themes. Overrides dsh-file-explorer's plain-text preview. | DSH Web 的 CodeMirror 6 代码预览与编辑插件——按语言语法高亮、就地编辑自动保存、深色/浅色主题,覆盖 dsh-file-explorer 的纯文本预览。

README excerpt

dsh-file-explorer-preview-code 中文 English A CodeMirror 6 code preview and editor for DSH Web, built on codemirror ( basicSetup ) + @codemirror/language-data (per-language highlighting) + @codemirror/theme-one-dark (dark theme). It overrides dsh-file-explorer's built-in plain-text preview (priority 0 ) at priority 10 , giving code files syntax highlighting plus in-place editing with autosave. Screenshots Dark theme Light theme Features 1. Syntax highlighting : resolves the language from the file name via @codemirror/language-data ( 90 languages), so .ts / .tsx / .js / .jsx / .json / .css / .html / .py / .yaml / .yml / .toml / .sh / .go / .rs / .java / .c / .cpp / .h / .xml / .sql / .ini each get the right tokens. 2. In-place editing : the preview is a real CodeMirror editor (line numbers, undo/redo, line wrapping), not a read-only . 3. Autosave : edits save 500ms after the last keystroke, plus Ctrl/Cmd+S saves immediately. 4. Save status bar : a slim footer shows the language, Ln/Col cursor position, and the save state ( Unsaved / Saving… / Saved / Save failed ) with a manual Save button. 5. Theme-aware : highlighting follows DSH's dark/light toggle ( data-ds-dark-theme ) live. 6. E…

View full README on GitHub →
Skins / UIdsh-plugin

Category