Foam/Q/How can I configure Foam to use a subfolder as the workspace root?
Properties
- logseq-entity
- Logseq/Entity/Question
How can I configure Foam to use a subfolder as the workspace root?
AI Answer
- AI/Response
- Answer/Official from foam.files.include — foambubble/foam package.json
- Short answer: two approaches work — a VS Code workspace file (
.code-workspace) or thefoam.files.includesetting. Method 1: VS Code workspace file (recommended for monorepos)
Method 2:
foam.files.includesetting- In
.vscode/settings.jsonat the repo root (or in the"settings"block of your.code-workspace): - json
{ "foam.files.include": ["my-garden/**"] } - Per the official description:
"Use this to limit Foam to specific directories (e.g., ["notes/**"]) or file types."Foam will only index and graph files undermy-garden/. VS Code's workspace root stays at the repo root, so daily-note and template paths in settings must be written relative to the repo root (e.g."foam.openDailyNote.directory": "my-garden/journals").
- In
Method 3: open the subfolder directly
Comparison
- - 1.
.code-workspacefile — cleanest for monorepo; all Foam-relative paths resolve insidemy-garden; lets VS Code also include sibling folders (e.g.tools/) if needed. - - 2.
foam.files.include— keeps the repo root open; useful when other VS Code tooling needs the full repo in scope; requires manually prefixing Foam path settings. - - 3. Open subfolder directly — simplest; loses easy access to repo-root tooling.
- - 1.
- AI/Response