unlinearity16k downloadsProfessional code file management with visual dashboard, syntax highlighting editor, Markdown embedding, external folder mounts, and terminal integration.
Editing, embedding, external mounts, and terminal integration.
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 five layers of "Space":

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

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

Embed and preview code in Markdown, including specific snippets from code files:
[[filename]].![[filename]].
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:
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.

Work across Vault boundaries to manage external project code.

Usage:
Important notes!
Run a real system shell inside Code Space, powered by xterm.js and node-pty.
Usage:
Important notes!
node-pty). Obsidian's plugin store only distributes JavaScript, so the helper is downloaded only when you select Download under Settings > Terminal: a prebuilt package (~1-3 MB) for your platform from this repository's GitHub releases, verified by SHA-256 checksum and stored under the plugin folder. Terminal commands and buttons never download anything by themselvesunzip utility (preinstalled on most distributions)pwsh.exe → powershell.exe → cmd.exe) on Windows, $SHELL → zsh on macOS, $SHELL → bash on Linux. Set an explicit executable in Settings > TerminalAccess configuration via Settings > Community plugins > Code Space:
Note: External mounts allow access to files outside the Vault. Only mount folders you trust.
| 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.

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 |
| Fortran | .f, .for, .f90, .f95, .f03, .f08 |
Dedicated |
| Other languages | .cmake, .dockerfile, .diff, .patch, .lua, .pl, .pm, .erb, .m |
Dedicated |
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 |

| 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 |
Ctrl+P → "Open terminal" |
Open a new terminal tab (available after enabling the terminal and downloading support files) |
Ctrl+P → "Toggle terminal panel" |
Toggle the embedded terminal panel in the current editor |
Ctrl+P → "Close all terminal sessions" |
Stop every terminal |
| Shortcut | Function |
|---|---|
Ctrl/Cmd+S |
Manually save the file |
Ctrl/Cmd+Mouse wheel |
Adjust font size (in the terminal: the focused terminal only) |
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 |
Code Space is available in the official Obsidian community plugin directory.
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.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.

npm install # Install dependencies
npm run dev # Development build (file watching)
npm run build # Production build
npm test # Run unit tests
npm run lint # Run ESLint
npm run dev:copy # Copy built artifacts to the local Vault
npm run dev:copy uses C:\Nonlinear\ob and .obsidian by default. Set OBSIDIAN_VAULT_PATH or OBSIDIAN_CONFIG_DIR when your Vault uses different paths.
Update the version in package.json, run the validation pipeline, and push a SemVer tag such as 2.4.0. GitHub Actions then validates the tag, builds the release artifacts, creates provenance attestations, and publishes main.js, manifest.json, and styles.css to the GitHub release.
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
│ ├── scrollbar_visibility.ts # Scrollbar visibility state for editors and embeds
│ ├── 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
│ ├── terminal/ # Integrated terminal (desktop only)
│ │ ├── types.ts # Shared terminal types and local pty interface
│ │ ├── node_access.ts # Runtime window.require access to Node APIs
│ │ ├── binary_manager.ts # node-pty prebuild download/verify/extract
│ │ ├── conout_patch.ts # Windows ConPTY renderer patch (node-pty)
│ │ ├── pty_host.ts # PtyProcess wrapper: load node-pty, spawn/kill
│ │ ├── shell_detector.ts # Platform default shell detection
│ │ ├── terminal_theme.ts # Obsidian theme vars to xterm theme mapping
│ │ ├── terminal_component.ts # xterm.js wrapper: attach/detach/fit
│ │ ├── session_manager.ts # TerminalManager: global session lifecycle
│ │ ├── terminal_panel.ts # Shared tab-bar panel (embedded + view hosts)
│ │ └── terminal_view.ts # Standalone terminal ItemView
│ └── 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
Contributions are welcome via Pull Request!
Please ensure:
For issues or suggestions, please use GitHub Issues.
Known limitations:
Code Space is also hosted on AtomGit, where you can browse the source code.
Thanks to everyone who reported issues and contributed pull requests.
If you find this plugin helpful or fun to use, you can buy me a bubble tea. ❤️ (WeChat tip QR code below)

This project is built upon the following excellent projects:
Make code management simple and efficient in Obsidian!