Edit Markdown notes outside your vault: paste images with portable relative paths, move notes with their attachments in or out, and link them from inside the vault.
在 Obsidian 中直接编辑仓库外的 Markdown 笔记:粘贴或拖入图片时自动保存到库外附件目录,并写入正确的相对路径;同时提供库内与库外之间的一键搬运,笔记和附件一起走、链接自动重写。
An Obsidian plugin for editing Markdown notes outside your vault: paste or drop images and get correct relative paths, create external notes from a template, and move notes together with their attachments in or out of the vault.
10 秒看懂:在库外笔记里粘贴截图 → 自动存到
External Vault/attachments并写入相对路径 → 右键标签页「移入 Vault」,笔记和附件一起搬回库内,链接自动重写。演示 GIF 待补:录制方法见 docs/演示录制.md,导出后命名为
docs/demo.gif,再在本节插入。
{{title}}、{{filename}}、{{date}}、{{date:YYYY-MM-DD}}、{{time}}。[[双链]] 和网络图片不会被搬动。插件目录/.undo/delete-<时间戳>/ 留一份副本(只保留最近 5 次),误删可从那里找回。[[ 也能选到外库:在笔记里输入 [[ 时,候选列表里会同时出现库内笔记和 External Vault 里的笔记(按文件名/相对路径),选中后插入 [[名字]],点击即可打开库外文件。外库索引加载完成后生效。[标题](../External%20Vault/笔记.md)),点击即可在 Obsidian 里打开库外文件,不会误建空笔记。编辑器右键 →「插入库外文件链接」会打开带搜索框的列表,勾选一篇或多篇后点「插入」,按当前笔记所在目录生成链接(多选时每行一个);换电脑后只要目录结构一致就能继续用。命令面板里也有同一入口。库外链接显示为红色、无下划线,与库内链接区分;悬停时 Hover Editor 或原生页面预览会直接显示库外文件的真实内容,不再提示「未创建」。unlink),设置面板会给出红色警示,此时插件会先在 .undo/move-<时间戳>/ 留一份备份(保留最近 5 次),「撤销上一次移动」仍然可用。External Vault/ 放 MD,External Vault/attachments/ 放附件。也可以只设置两个相对目录,改用自定义模式。父目录/
├── 你的库/ ← Obsidian vault(含 .obsidian)
└── External Vault/ ← 库外 MD
├── 笔记.md
└── attachments/ ← 库外附件
main.js、manifest.json、styles.css,放入
<vault>/.obsidian/plugins/external-vault/,然后在 Obsidian 中启用。默认目标:移出时 MD 落到 External Vault/、附件落到 External Vault/attachments/;移入时 MD 落到库根目录、附件落到库内默认附件文件夹。
笔记移入 / 移出后,插件会扫描库内和库外的所有 Markdown,把引用它的链接改写掉:
| 方向 | 原链接 | 改写后 |
|---|---|---|
| 库内 → 库外 | [[笔记]] |
[笔记](../External Vault/笔记.md) |
| 库外 → 库内 | [笔记](../External Vault/笔记.md) |
[[笔记]] |
#标题、|别名 的 wiki 链接也能识别vault.process 修改,可撤销| 拖动 | 放到 | 结果 |
|---|---|---|
| 库内文件列表 | 右侧面板 | 移出 Vault |
| 右侧面板 | 库内文件列表 | 移入 Vault |
| 右侧面板 | 编辑器正文 | 插入相对链接(图片为 ![]()) |
移动完成后右侧面板会立即刷新。
笔记 1.md),引用链接仍按原名改写,需要手动确认) 的文件名,手写链接时需写成 %29—、别名不参与搜索、库外笔记之间的链接不参与反向改写;按文件名搜索、打开、移入 / 移出、拖拽都不受影响。.obsidian/plugins/external-vault/index.json(约 200 B/条,20 万篇约 40 MB)。首次建立 20 万篇约 4 秒,之后只按变化的文件增量更新,不再整库重扫。metadataCache 反向索引:移动 / 重命名只读真正引用它的那几篇笔记。所有功能都有命令入口,统一以「库外文件:」开头。在命令面板输入「库外文件」即可一次看到全部,也可以给任意一条设置快捷键:
| 命令 | 作用 |
|---|---|
| 新建 Markdown | 在库外 MD 目录新建并打开 |
| 打开 External Vault 菜单 | 等同 Ribbon 文件夹按钮的完整菜单 |
| 打开最近编辑的笔记 | 打开最近修改的库外 MD |
| 查看全部 / 批量删除 | 带搜索的文件管理器 |
| 插入相对链接(可多选) | 在当前库内笔记插入库外链接 |
| 删除当前库外 MD(含附件) | 删除当前打开的库外笔记 |
| 移入 Vault(当前文件) | 当前库外 MD + 附件搬进库 |
| 移出 Vault(当前笔记) | 当前库内笔记 + 附件搬到库外 |
| 移入 Vault(整个库外目录) | 批量搬入库 |
| 移出 Vault(当前笔记所在文件夹) | 批量搬出库 |
| 移出 / 移入 Vault(右键动作) | 与右键菜单等价 |
| 在文件管理器中打开 MD 目录 | 系统访达 / 资源管理器 |
| 在文件管理器中打开附件目录 | 同上 |
| 复制 External Vault 路径 | 复制库外 MD 目录绝对路径 |
| 复制附件目录路径 | 复制库外附件目录绝对路径 |
| 修复当前笔记的图片链接 | 修复坏链 |
| 诊断当前库外文件 | 复制诊断信息 |
本插件会读写 Obsidian vault 之外的文件,这是它的核心功能,原因如下:
访问范围仅限你在设置中指定的两个目录(默认是 vault 同级的 External Vault/ 与其 attachments/)。插件不联网、不上传任何内容、不包含遥测,也不会访问你未指定的其他路径。删除源文件前会先确认目标文件全部写盘成功;被其他笔记共用的附件只复制、不删除;两个目录之外的附件(例如 ../Pictures/photo.jpg)也只复制、保留原件。
| 变量 | 输出 |
|---|---|
{{title}} |
笔记标题(不含 .md) |
{{filename}} |
笔记文件名(含 .md) |
{{date}} |
当前日期,默认 YYYY-MM-DD |
{{date:YYYY/MM/DD}} |
自定义格式的日期 |
{{time}} |
当前时间 HH:mm |
main.js 是构建产物,本仓库直接以它作为源码维护;修改后用 node --check main.js 做语法校验,再重载 Obsidian 验证。
注意:本仓库就放在
<vault>/.obsidian/plugins/external-vault/里,main.js既是源码、也是正在运行的插件本体。改之前先git commit(或复制一份),否则插件更新或网盘同步冲突会直接覆盖本地改动。
发布新版本:
./release.sh 1.10.8
脚本会自动改 manifest.json、versions.json 和代码里的版本号,跑语法校验,然后 commit、打 tag、push;装了 gh 会直接创建 Release,没装会打印网页链接,手动上传 main.js、manifest.json、styles.css 即可。
External Vault lets you edit Markdown notes that live outside your vault:
{{title}}, {{filename}}, {{date}}, {{date:FORMAT}}, and {{time}}.[Title](../External%20Vault/note.md) opens the external file in Obsidian instead of creating an empty note. Use the editor context menu → "Insert link to external file" (or the same command), search the list, select one or more notes, and click Insert; links are generated from the current note's folder, one per line when multiple files are selected. External links are shown in red without an underline; hovering one opens a real preview of the external file in Hover Editor or the native page preview instead of reporting it as missing.External Vault/ folder for notes and External Vault/attachments/ for attachments, or two custom relative directories.External file access: this plugin reads and writes files outside the vault, limited to the two directories you configure. It is required because Obsidian's native paste/drop writes attachments into the vault, and because moving notes in or out of the vault must touch both locations. The plugin makes no network requests, collects no telemetry, and uploads nothing. Source files are removed only after every target file is verified on disk; attachments shared with other notes are copied, not deleted.
Desktop only (Obsidian 1.14+).