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
  • Join the community
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

Code Space

unlinearityunlinearity5k downloads

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

Add to Obsidian
  • Overview
  • Scorecard
  • Updates14

Code Space Preview


About the plugin

Code Space is available in the official Obsidian community plugin directory.🎉

Obsidian's native workflow is centered on Markdown notes, so its support for centralized code file browsing, management, editing, structural navigation, and exporting embedded code is limited. Code Space was created to fill that gap.

The four layers of "Space":

  1. Management space: Provides a unified index and management area for code files, so you can browse code files through a visual dashboard.
  2. Editing space: Opens code files in a dedicated environment for viewing and editing.
  3. Embedding space: Works with Obsidian's native features to support references, embedded code previews, and native PDF export as real code blocks.
  4. Mount space: Mount external folders into the Vault via system symlinks/junctions for cross-project code management.

Star History Chart


Core features

1. Code file management space

Provides a visual dashboard for unified indexing and management of code files within the vault.

  • Visual dashboard: A management interface with grid layout and file status overview.
  • Integrated management tools: The header provides quick access to Settings, Create file, and ignored item management.
  • Multi-dimensional dynamic filtering: Filter by folder and extension, search by filename or path, and sort by modified date, name, or type.
  • Standard file operations: Use Obsidian-supported operations such as rename, move, delete, reveal in navigation, and open in the default app.
  • Dashboard state memory: Search, filter, and sort state is saved with the plugin settings for smoother repeated use.

2. Professional code editing space

Provides an IDE-like environment for code viewing and editing.

  • Syntax highlighting: Powered by CodeMirror 6 with accurate highlighting for many languages.
  • Structured navigation: Code outline view that parses classes, functions, and methods with click-to-jump navigation.
  • Advanced search and replace: Dedicated search panel with regex, case sensitivity, whole-word matching, single replacement, and replace all.
  • Manual save: Ctrl/Cmd+S manual save with unsaved-state feedback and cursor position protection to prevent viewport jumps.
  • Basic editing helpers: Auto indentation, bracket matching, code folding, and line numbers.
  • Interaction optimizations: Ctrl/Cmd+wheel font scaling and a floating search button for quick access.

3. Obsidian native embedding space

Embed and preview code in Markdown, including specific snippets from code files:

  • File references: Link code files with [[filename]].
  • Code embedding: Embed previews in Markdown with ![[filename]].
  • Line ranges: Specify start lines or line ranges to embed code snippets precisely.
  • Quick preview: Hover links to preview code content.
  • Open source files in several ways: Click the embed header to open the source file. Ctrl/Cmd+click opens it in a new tab, Ctrl/Cmd+Shift+click opens it in a new window, and Ctrl/Cmd+Alt/Option+click opens it in a split pane.
  • Preview sync: When a source code file changes, related embedded previews are re-rendered.
  • Native PDF export: Use Obsidian's official Export to PDF and code file references are exported as real code blocks instead of gray file cards.
  • Broader host compatibility: Embedded code previews behave more reliably in reading mode, pop-out windows, and other hosts that reuse Obsidian's Markdown render pipeline.

Supported embed syntax:

Syntax Description
![[test.py]] Embed the entire file
![[test.py#20]] Display from line 20 to end of file
![[test.py#L20]] Same as above (GitHub-style with L prefix)
![[test.py#20-40]] Display lines 20 to 40
![[test.py#L20-L40]] Same as above (GitHub-style)
![[test.py#L20-40]] Mixed format also supported

Line range features:

  • In range mode, displays the full specified range ignoring the "Max embed lines" setting
  • If end line exceeds file length, automatically truncates to end of file
  • If end line is less than start line, automatically adjusts to single line display
  • Line numbers are consistent with the original file

Tip: When a note contains code file embeds, export it with Obsidian's official Export to PDF. Code Space keeps those embeds as real code blocks in the final PDF while preserving Obsidian's native layout and pagination.

4. External mount space (desktop only)

Work across Vault boundaries to manage external project code.

  • Symlinks/junctions: Create and manage symlinks (macOS/Linux) or directory junctions (Windows) from the settings page to mount external folders into the Vault
  • Integrated workflow: Code files in mounted folders appear in the dashboard with Code Space functionality such as editing, embedding, and outline navigation
  • Bidirectional sync: Edits made from either Obsidian or the external folder affect the same underlying files
  • Cross-project work: Manage distributed code repositories directly without copying project code into the Vault
  • Mount status management: View mount status, remove or relink mounts, and choose auto, symlink, or junction mode on Windows

Usage:

  1. Open Settings > Community plugins > Code Space
  2. Enable External folders
  3. Click Add external folder, choose a source folder outside the Vault, and set its mount location inside the Vault
  4. Code Space creates the link, saves the configuration, and indexes code files inside the mounted folder

Important notes!

  • Desktop only: External mounts are unavailable on iOS/Android due to sandbox restrictions
  • Security risk: External mounts allow the plugin to access files outside the Vault. Only mount folders you trust
  • Permission differences: On Windows, symlinks may require Developer Mode or administrator privileges. Auto mode tries symlink first, then falls back to junction
  • Performance issues: You can use this for lightweight repositories or multi-repository coordination, but avoid mounting too many files or very large directories
  • Path stability: Moving or renaming external folders will break the mount and require reconfiguration
  • Sync issues: If external folders are in cloud-synced directories (e.g., Dropbox, OneDrive), ensure Obsidian and external folders are in sync to avoid conflicts

Configuration

Access configuration via Settings > Community plugins > Code Space:

  • Managed extensions: Specify file extensions managed by Code Space (comma-separated). Changes refresh the managed file associations.
  • Show line numbers: Toggle line numbers (default: on)
  • Editor font size: Font size for the code editor (default: 18px, range: 9-36px)
  • Embed font size: Font size for embedded code blocks in Markdown (default: 15px, range: 9-36px)
  • Max embed lines: Maximum lines shown in embedded previews (default: 20, 0 for unlimited)
  • Location for new code files: Create new code files in a custom folder or in the folder of the currently active file
  • External folders (desktop only): Mount external folders into the Vault via system symlinks/junctions. You can enable or disable the feature, add, remove, relink, and inspect mounts.

Note: External mounts allow access to files outside the Vault. Only mount folders you trust.

Supported languages (extensible)

1. Default supported extensions

Language Extensions
Python .py
C/C++ .c, .cpp, .h, .hpp, .cc, .cxx
JavaScript/TypeScript .js, .ts, .jsx, .tsx, .mjs, .cjs, .json
Web Technologies .html, .htm, .xhtml, .css, .scss, .sass, .less
Systems Programming .rs, .go, .java, .cs
Data/Config .sql, .yaml, .yml, .xml
Scripting .php, .r, .rb, .sh

You can add more extensions in plugin settings. Code Space can manage files with custom extensions.

  • Text and code files open in the Code Space editor interface
  • Binary files (e.g., images or PDFs) open with Obsidian's native viewer or the system default app. You can also use the dashboard to manage attachments like PDFs

2. Additional text/code extensions with syntax highlighting

Add the following extensions in Settings > Code Space > Managed extensions to enable:

Language Extensions Highlighting reused from
XML family .xsd, .xsl, .xslt, .wsdl, .plist, .csproj, .vcxproj, .props, .targets, .config XML
.urdf, .xacro XML
C/C++ family .ino, .pde, .nut C/C++
.cu, .cuh, .glsl, .vert, .frag, .hlsl, .mm, .swift C/C++
Java family .kt, .kts, .scala, .groovy, .gradle Java
Frontend frameworks .vue, .svelte, .astro JavaScript
JSON variants .json5, .jsonc JavaScript
Python family .pyx, .pxd, .pxi, .ipy Python
Config files .toml, .ini, .cfg, .conf YAML
Shell scripts .bash, .zsh Shell
PowerShell .ps1, .psm1, .psd1 PowerShell
Other languages .cmake, .dockerfile, .diff, .patch, .lua, .pl, .pm, .erb, .m Dedicated

3. Binary file support (opened with Obsidian native viewer)

If you add the following extensions to the managed list, these files can also be managed in the Code Space dashboard (rename, move, delete, etc.). They are not opened by the Code Space editor; they use Obsidian's native viewer or the system default app.

Type Extensions
Images .png, .jpg, .jpeg, .gif, .webp, .svg, .bmp, .ico, .tiff, .psd
Documents .pdf
Audio .mp3, .wav, .ogg, .flac, .aac, .m4a, .wma
Video .mp4, .avi, .mkv, .mov, .wmv, .flv, .webm, .m4v
Archives .zip, .rar, .7z, .tar, .gz, .bz2, .xz
Office .doc, .docx, .xls, .xlsx, .ppt, .pptx
Other .exe, .dll, .so, .dylib, .bin, .dat

Supported keyboard shortcuts

1. Plugin commands

Command path Function
Ctrl+P → "Open dashboard" Open the code management panel
Ctrl+P → "Create code file" Create a new code file
Ctrl+P → "Reload plugin" Reload the plugin
Ctrl+P → "Toggle code outline" Toggle the code outline view
Ctrl+P → "Search and replace" Open the search and replace panel in the current Code Space editor

2. Basic operations

Shortcut Function
Ctrl/Cmd+S Manually save the file
Ctrl/Cmd+Mouse wheel Adjust font size
Ctrl/Cmd+F Search
Ctrl+H / Cmd+Option+F Replace
Ctrl/Cmd+C Copy selection
Ctrl/Cmd+X Cut selection
Ctrl/Cmd+V Paste content
Ctrl/Cmd+A Select all
Ctrl/Cmd+Z Undo
Ctrl+Y or Ctrl/Cmd+Shift+Z Redo
Tab Increase indent
Shift+Tab Decrease indent
Enter New line and preserve indent
Cursor navigation Selection and editing
↑ ↓ ← → Move cursor up/down/left/right Shift+Arrow Keys Extend selection
Home Jump to line start Ctrl+Shift+← Select to word start
End Jump to line end Ctrl+Shift+→ Select to word end
Ctrl+← Move left one word Ctrl+Shift+Home Select to file start
Ctrl+→ Move right one word Ctrl+Shift+End Select to file end
Ctrl+Home Jump to file start Backspace Delete character before cursor
Ctrl+End Jump to file end Delete Delete character after cursor
Page Up Page up Ctrl+Backspace Delete word before cursor
Page Down Page down Ctrl+Delete Delete word after cursor

Installation

Method 1: Install from Obsidian community plugins (recommended)

Code Space is available in the official Obsidian community plugin directory.

  1. Open Settings > Community plugins.
  2. If Obsidian asks, turn off Restricted mode.
  3. Click Browse.
  4. Search for "Code Space".
  5. Click Install and enable the plugin.

Method 2: Manual installation

  1. Visit Releases.
  2. Download main.js, manifest.json, and styles.css. Place them in your vault plugin directory: .obsidian/plugins/code-space/. If the code-space folder does not exist, create it manually.
  3. Reload and enable the plugin in Obsidian settings.

Method 3: BRAT

Use BRAT only if you want to test a development or prerelease build. Install the BRAT plugin first, then add this repository as a beta plugin: https://github.com/UNLINEARITY/Obsidian-CodeSpace, and select the latest version. Most users should install the community plugin version.


Development

Build requirements

  • Node.js 18 or later (current LTS recommended)
  • npm

Build commands

npm install          # Install dependencies
npm run dev          # Development build (file watching)
npm run build        # Production build
npm run lint         # Run ESLint

Project structure

obsidian-codespace/
├── src/
│   ├── main.ts                # Plugin entry: command registration, view mounting, and lifecycle management
│   ├── code_view.ts           # Editor core: CodeMirror 6 editing environment
│   ├── dashboard_view.ts      # Dashboard view: file indexing and management UI
│   ├── outline_view.ts        # Outline view: sidebar structured navigation
│   ├── code_parser.ts         # Syntax parser: multi-language structure analysis
│   ├── code_embed.ts          # Embed processing: reference and preview logic
│   ├── code_embed_markdown.ts # Code embed expansion for native PDF export and related flows
│   ├── native_pdf_export_patch.ts # Native Export to PDF integration and export-chain patch
│   ├── dropdown.ts            # UI components: dropdown/multi-select
│   ├── folder_filter_modal.ts # Folder filter modal
│   ├── ignore_manager_modal.ts # Ignored file/folder manager modal
│   ├── external_mount.ts      # External mounts: symlink/junction management
│   ├── settings.ts            # Settings panel: plugin configuration
│   └── lang/
│       ├── helpers.ts         # Localization helpers
│       └── locale/
│           ├── en.ts          # English strings
│           └── zh-cn.ts       # Chinese strings
├── styles.css                 # Styles entry
├── manifest.json              # Plugin metadata
└── package.json               # Dependencies and scripts

Contributing

Contributions are welcome via Pull Request!

Please ensure:

  1. Code passes ESLint checks
  2. Follow the existing code style
  3. Commit messages are clear and descriptive

For issues or suggestions, please use GitHub Issues.

  • Author: unlinearity
  • Email: [email protected]
  • MIT License - Copyright (c) 2026 unlinearity

Known limitations:

  • Code file contents are currently not indexed by Obsidian's global search engine. Use the Code Space search and replace panel for the current file.

Acknowledgments

This project is built upon the following excellent projects:

  • Obsidian API: Provides powerful plugin extensibility.
  • CodeMirror 6: Flexible and modern code editor engine.
  • Lezer: Efficient incremental code parsing system.
  • TypeScript: Provides robust type safety.
  • esbuild: Extremely fast JavaScript bundler.

Make code management simple and efficient in Obsidian!

92%
HealthExcellent
ReviewSatisfactory
About
Manage code files in your vault with a visual dashboard, unified index, dynamic filtering and standard file operations. Edit and view code in an IDE-like space with CodeMirror 6 syntax highlighting, outline navigation, regex search/replace, embedded previews, PDF export and folder mounts via symlinks.
CodeEditingFiles
Details
Current version
2.3.0
Last updated
Yesterday
Created
4 months ago
Updates
14 releases
Downloads
5k
Compatible with
Obsidian 1.7.2+
License
MIT
Report bugRequest featureReport plugin
Author
unlinearityunlinearity
github.com/UNLINEARITY
GitHubunlinearity
  1. Community
  2. Plugins
  3. Code
  4. Code Space

Related plugins

Remember cursor position

Remember cursor and scroll position for each note.

Thino

Quickly capture memos and display them in the sidebar with a heatmap. (Closed source)

Note Refactor

Extract note content into new notes and split notes.

VSCode Editor

Edit Code Files like VSCode.

Filename Heading Sync

Keep the filename with the first heading of a file in sync.

Advanced Tables

Improved table navigation, formatting, and manipulation.

Notebook Navigator

Alternative file browser with folders, tags, properties, calendar, previews, shortcuts, recent files, keyboard navigation, drag and drop, and pinned notes.

Templater

Create and use dynamic templates.

Recent Files

Display a list of recently opened files.

Omnisearch

Intelligent search for your notes, PDFs, and OCR for images.