Search...Search plugins and themes...
⌘K
Sign in
  • Get started
  • Download
  • Pricing
  • Enterprise
  • Account
  • Obsidian
  • Overview
  • Sync
  • Publish
  • Canvas
  • Mobile
  • Web Clipper
  • CLI
  • Learn
  • Help
  • Developers
  • Changelog
  • About
  • Roadmap
  • Blog
  • Resources
  • System status
  • License overview
  • Terms of service
  • Privacy policy
  • Security
  • Community
  • Plugins
  • Themes
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

Code Viewer

KevinKevin24 downloads

View and edit code files with native syntax highlighting.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates4

Code Viewer

<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>

Code Viewer 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.

Features

  • Native syntax highlighting — uses Obsidian's built-in MarkdownRenderer, so colors always match your current theme
  • Automatic extension registration — .py, .ts, .js, .sh, .rs, .go, and 50+ more extensions open directly in Code Viewer
  • Line numbers — optional gutter with configurable line numbers
  • Zero dependencies — no external libraries at runtime, only Obsidian APIs
  • Read-only by design — prevents accidental edits to source files
  • Optional code editing — edit source files in-place via a temporary markdown file, with save and view controls
  • Declarative settings — uses Obsidian 1.13+ settings API for native search and consistency
  • Multi-language UI — English, 中文, Русский support

Usage

  1. Install and enable the plugin
  2. Click any supported file (.py, .ts, .sh, etc.) in the file explorer
  3. The file opens in a read-only Code View with syntax highlighting
  4. Click the edit button (top-right) to create a temporary .md file for editing
  5. Use Save and View buttons in the editor to sync changes back

You can customize which extensions are handled via Settings → Code Viewer.

Settings

Setting Default Description
File extensions 50+ extensions Comma-separated list of extensions to open with Code Viewer
Show line numbers On Toggle line number gutter
Enable code editing On Show edit button for inline source editing
Edit open mode Current tab Where to open the editor: current tab or new tab

Requirements: Obsidian 1.13.0 or later.

Note: Changing the extension list requires an Obsidian reload (Ctrl+R) to take effect.

Supported Languages

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, Dockerfile, Makefile, CMake, XML, HTML, CSS, SCSS, Less, JSON, JSON5, HCL, Protobuf, GraphQL, and more.

Installation

From Obsidian Community Plugins

  1. Open Settings → Community plugins
  2. Disable Safe mode
  3. Click Browse and search for "Code Viewer"
  4. Install and enable

Manual

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.

Development

  1. Copy .env.example to .env and set VAULT_PATH to your Obsidian vault path:
    VAULT_PATH=C:/Users/YourName/Documents/MyVault
    
  2. Install dependencies and start developing:
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
HealthExcellent
ReviewPassed
About
View and edit code files with Obsidian's native syntax highlighting so colors always match your theme. Open 50+ extensions with an optional line-number gutter, keep files read-only by default to avoid accidental edits, and enable inline editing via a temporary Markdown file with save/view controls.
CodeEditingSyntax
Details
Current version
1.0.3
Last updated
2 days ago
Created
2 days ago
Updates
4 releases
Downloads
24
Compatible with
Obsidian 1.13.4+
Platforms
Desktop, Mobile
License
MIT
Report bugRequest featureReport plugin
Sponsor
Support
Author
KevinKevintracingorigins
GitHubtracingorigins
  1. Community
  2. Plugins
  3. Code
  4. Code Viewer

Related plugins

VSCode Editor

Edit Code Files like VSCode.

Code Space

Professional code file management with visual dashboard, syntax highlighting editor, and Markdown embedding.

Inline Encrypter

Encrypt secrets in your notes.

Shiki Highlighter

Highlight code blocks with Shiki.

Advanced Tables

Improved table navigation, formatting, and manipulation.

Meta Bind

Make your notes interactive with inline input fields, metadata displays, and buttons.

Mermaid Tools

Improved Mermaid.js experience: visual toolbar with common elements and more.

Outliner

Work with your lists like in Workflowy or Roam Research.

Templater

Create and use dynamic templates.

Creases

Tools for effectively folding Markdown sections.