Edit non-markdown text files (code, config, data files) directly in Obsidian with syntax highlighting, line numbers, and word wrap.
- Edit 50+ file types directly in Obsidian (JS, TS, Python, Go, Rust, JSON, YAML, HTML, CSS, SQL, and more)
- Syntax highlighting with 5 built-in color themes (Monokai Pro, GitHub Dark, GitHub Light, Dracula, Nord)
- Line numbers with active line highlighting
- Word wrap toggle
- Bracket matching
- Undo/redo history
- Tab indentation support
- Binary file detection (prevents editing binary files)
- Add custom file extensions
Might not be approved yet
- Open Settings > Community Plugins
- Search for Code Editor
- Click Install, then Enable
- Download
main.js,manifest.json, andstyles.cssfrom the latest release - Create a folder called
code-editorin your vault's.obsidian/plugins/directory - Copy the downloaded files into that folder
- Restart Obsidian and enable the plugin in Settings > Community Plugins
Once enabled, the plugin automatically handles supported file types. Simply open any supported file and it will open in the code editor.
Code: js, ts, jsx, tsx, py, rb, go, rs, java, c, cpp, h, cs, php, swift, kt, scala, lua, pl, r, m, mm
Config/Data: json, yaml, yml, toml, xml, ini, env, conf
Web: html, htm, css, scss, sass, less
Shell/Scripts: sh, bash, zsh, fish, ps1, bat, cmd
Other: sql, graphql, dockerfile, makefile, gitignore, txt, log
- Enable code editor - Toggle the plugin on/off (restart required)
- Color theme - Choose from 5 syntax highlighting themes
- Show line numbers - Toggle line number gutter
- Word wrap - Toggle line wrapping
- Additional file extensions - Add custom extensions (comma-separated)
- Open current file in Code Editor - Available from the command palette for non-markdown files
This plugin uses highlight.js for syntax highlighting, licensed under the BSD 3-Clause License. Copyright (c) 2006, Ivan Sagalaev.