Obsidian Vault (WSL)
Use this skill when the vault lives on Windows but is being accessed from WSL through /mnt/<drive>.
Workflow
- 1. Identify the vault root from the user-provided path before doing broad searches or edits.
- Operate on the filesystem path directly; Obsidian does not require a special API for normal note work.
- Preserve existing frontmatter, wiki-links, embeds, headings, and folder structure unless the user asks to change them.
Vault Location
Do not assume a fixed vault path.
Common patterns:
- - Windows: INLINECODE1
- Windows: INLINECODE2
- WSL: INLINECODE3
- WSL: INLINECODE4
Treat the vault root as the directory containing the Obsidian note tree.
Path Translation
CODEBLOCK0
Replace backslashes with forward slashes and lowercase the drive letter under /mnt/<drive>.
Common Operations
Read a note
CODEBLOCK1
Search the vault
Prefer rg for speed:
CODEBLOCK2
Edit a note
Edit the markdown file in place with targeted changes instead of rewriting the whole note when possible.
Create a new note
Use a minimal template when metadata is needed:
CODEBLOCK3
Obsidian Conventions
- - Notes are markdown files ending in INLINECODE7
- YAML frontmatter is commonly used for metadata such as
title, tags, and INLINECODE10 - Internal links use INLINECODE11
- Embeds use INLINECODE12
- Callouts use INLINECODE13
Working Rules
- - Confirm the vault root before making broad searches or bulk changes
- Prefer targeted edits over full-file rewrites
- Keep filenames, wiki-links, and folder structure consistent with the existing vault
Obsidian Vault (WSL)
当笔记库位于Windows系统,但通过WSL的/mnt/<驱动器>路径访问时,使用此技能。
工作流程
- 1. 在进行广泛搜索或编辑前,先根据用户提供的路径确定笔记库根目录。
- 直接操作文件系统路径;常规笔记操作无需使用Obsidian的特殊API。
- 除非用户要求修改,否则保留现有的前置元数据、Wiki链接、嵌入内容、标题和文件夹结构。
笔记库位置
不要假定固定的笔记库路径。
常见模式:
- - Windows:C:\Users\<用户名>\Documents\<笔记库>\
- Windows:D:\Notes\<笔记库>\
- WSL:/mnt/c/Users/<用户名>/Documents/<笔记库>/
- WSL:/mnt/d/Notes/<笔记库>/
将笔记库根目录视为包含Obsidian笔记树的目录。
路径转换
text
Windows -> WSL:C:\path\to\file -> /mnt/c/path/to/file
Windows -> WSL:D:\path\to\file -> /mnt/d/path/to/file
WSL -> Windows:/mnt/c/path -> C:/path
WSL -> Windows:/mnt/d/path -> D:/path
将反斜杠替换为正斜杠,并将/mnt/<驱动器>下的驱动器字母转换为小写。
常见操作
读取笔记
bash
cat /mnt/<驱动器>/<笔记库>/<路径>/<文件名>.md
搜索笔记库
优先使用rg以提高速度:
bash
rg 搜索词 /mnt/<驱动器>/<笔记库>/
编辑笔记
直接对markdown文件进行针对性修改,尽可能避免重写整个笔记。
创建新笔记
当需要元数据时,使用最小模板:
markdown
title:笔记标题
tags:[]
笔记标题
Obsidian约定
- - 笔记是以.md结尾的markdown文件
- YAML前置元数据常用于存储title、tags和aliases等元数据
- 内部链接使用[[笔记名称]]
- 嵌入内容使用![[笔记名称]]
- 标注使用> [!类型]
工作规则
- - 在进行广泛搜索或批量修改前,确认笔记库根目录
- 优先进行针对性编辑,而非重写整个文件
- 保持文件名、Wiki链接和文件夹结构与现有笔记库一致