Edit code files in your Obsidian vault with syntax highlighting, code folding, search and replace, and autocompletion. Built on CodeMirror 6.
| Editor and create file dialog | Settings |
|---|---|
![]() |
![]() |
Note
Requires Obsidian 1.13.0 or later.
- Syntax highlighting for 24 languages, from Python and TypeScript to Rust, Go, and Swift
- 45 color themes, or colors that follow your Obsidian theme
- Search and replace with match case, regex, and whole word options
- Code folding, indent guides, line numbers, and word wrap
- Autocompletion, bracket matching, and auto-closing brackets
- Multiple cursors and rectangular selection
- Zoom with Ctrl/Cmd+scroll
- Create code files from the command palette or file explorer
- Rename a file including its extension, which Obsidian's own rename can't do
- Full file names in tabs, so
app.tsandapp.jsare easy to tell apart
New here? Read the user guide. It covers every feature, setting, and shortcut.
- Open Settings → Community plugins → Browse.
- Search for "CM Code Editor".
- Select Install, then Enable.
Or install it from community.obsidian.md.
- Download
main.js,manifest.json, andstyles.cssfrom the latest release. - Create the folder
.obsidian/plugins/cm-code-editorinside your vault. - Move the three files into it.
- In Settings → Community plugins, reload the installed plugins list and enable CM Code Editor.
Files with these extensions open in the code editor right away:
c cpp css go html java js json lua php py rb rs sh sql toml ts xml yaml
To add more, edit File extensions in the plugin settings, then turn the plugin off and on again. The user guide lists every extension with highlighting.
See CONTRIBUTING.md.

