Kevin128 downloadsView and edit code files with native syntax highlighting.
<p>[<a href="https://github.com/TracingOrigins/obsidian-code-viewer-plugin/blob/master/README.zh.md">中文</a> | English | <a href="https://github.com/TracingOrigins/obsidian-code-viewer-plugin/blob/master/README.ru.md">Русский</a>]</p>
<p><a href="https://community.obsidian.md/account/plugins/code-viewer" target="_blank">Code Viewer</a> is an Obsidian plugin for viewing and editing code files. Click any supported file to open it with native syntax highlighting, or use the inline editor to make quick changes — no external dependencies.</p>
MarkdownRenderer, so colors always match your current theme.py, .ts, .js, .sh, .rs, .go, and 50+ more extensions open directly in Code Viewer.py, .ts, .sh, etc.) in the file explorer.md file for editingYou can customize which extensions are handled via Settings → Code Viewer.
| Setting | Default | Description |
|---|---|---|
| File extensions | 50+ extensions | Comma-separated list of file extensions to open with Code Viewer |
| Show line numbers | On | Toggle the line number gutter |
| Enable code editing | On | Show the edit button for inline source editing |
| Edit open mode | Current tab | Where the editor opens: current tab or a new tab |
Requirements: Obsidian 1.13.0 or later.
Note: Changing the extension list requires reloading Obsidian (Ctrl+R) to take effect.
Python, PowerShell, Bash, TypeScript, TSX, JavaScript, JSX, C#, C, C++, SQL, YAML, TOML, Rust, Go, Lua, GDScript, Batch, Ruby, PHP, Perl, R, Dart, Kotlin, Swift, Vue, Svelte, INI, XML, HTML, CSS, SCSS, Less, JSON, JSON5, HCL, Protobuf, GraphQL, and more.
cd /path/to/vault/.obsidian/plugins
git clone https://github.com/TracingOrigins/obsidian-code-viewer-plugin.git code-viewer
cd code-viewer
npm install && npm run build
Then enable the plugin in Settings → Community plugins.
.env.example to .env and set VAULT_PATH to your Obsidian vault path:VAULT_PATH=C:/Users/YourName/Documents/MyVault
npm install # install dependencies
npm run dev # watch mode (auto-deploys to vault)
npm run build # production build (auto-deploys to vault)
npm run lint # run eslint