You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add `obsidianVFS.workspaceFile` setting that generates a named
<project>.code-workspace file containing the vault folder entry and
existing workspace settings from .vscode/settings.json. Prompts the
user to open it (one-time reload), then manages files.exclude patterns
in the workspace file's settings section on subsequent activations.
Assisted-by: Claude
Copy file name to clipboardExpand all lines: packages/vscode/README.md
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,7 @@ Browse, search, and edit your [Obsidian](https://obsidian.md) vault directly in
19
19
-**Auto-mount** configured folders on startup
20
20
-**Status bar** showing vault name and connection mode (`full` / `degraded`)
21
21
-**Workspace folder**, vault browsable in Explorer with Quick Open (`Cmd+P`) and Search (`Ctrl+Shift+F`) support
22
+
-**Workspace file**, generate a named `.code-workspace` to avoid the "Untitled Workspace" label
22
23
-**File watching**, changes in the vault are reflected in real time
23
24
24
25
## Commands
@@ -47,6 +48,7 @@ Configure via **Settings UI** or `settings.json`:
47
48
|`obsidianVFS.explorer`|`boolean`|`true`| Show the Obsidian VFS tree view in the Explorer sidebar |
48
49
|`obsidianVFS.statusBar`|`boolean`|`true`| Show vault name and mode in the status bar |
49
50
|`obsidianVFS.workspace`|`boolean`|`true`| Add the vault as a workspace folder for Quick Open and Search (see below) |
51
+
|`obsidianVFS.workspaceFile`|`boolean`|`false`| Generate a `.code-workspace` file named after the project folder. Eliminates the "Untitled (Workspace)" label. The file contains a `file://` vault folder entry; `files.exclude` patterns are written to its `settings` section. Opening the file triggers a one-time window reload. |
50
52
51
53
All three toggle settings (`explorer`, `statusBar`, `workspace`) take effect immediately — no reload required.
52
54
@@ -79,6 +81,35 @@ Non-autoMount vault content (`.obsidian/`, `.trash/`, and any directories not in
79
81
- The Explorer tree view and the workspace folder both appear in the sidebar. The tree view provides custom UI (welcome view, context menus, drag-and-drop), while the workspace folder enables Quick Open and full-text search.
80
82
- The `obs://` FileSystemProvider remains registered for the TreeView sidebar, wikilink navigation, and drag-and-drop — it does not back a workspace folder.
When `obsidianVFS.workspace` adds the vault folder dynamically, VS Code transitions to a multi-root workspace. Because no `.code-workspace` file is involved, the title bar shows **"UNTITLED (WORKSPACE)"** — this is standard VS Code behavior for unsaved multi-root workspaces.
87
+
88
+
Enable `obsidianVFS.workspaceFile` to fix this. The extension generates a `<project-name>.code-workspace` file in your project root (e.g., `my-app.code-workspace`) and prompts you to open it.
89
+
90
+
**What happens when you enable it:**
91
+
92
+
1. The extension creates `<project-name>.code-workspace` in your project root containing the local folder(s) and the `file://` vault folder entry (named `obs://<VaultName>`).
93
+
2. A notification asks: _"Open workspace file? This will reload the window."_
94
+
3. If you click **Open**, the window reloads once. After that, the title bar shows the project name and the vault is part of the saved workspace.
95
+
4. On subsequent activations, the extension detects you're already in a saved workspace and skips the prompt. `files.exclude` patterns are written to the `.code-workspace` file's `settings` section (via `ConfigurationTarget.Workspace`) instead of `.vscode/settings.json`.
96
+
5. If you click **Not Now**, the extension falls back to adding the vault dynamically via `updateWorkspaceFolders` (with `files.exclude` patterns in `.vscode/settings.json`). You can open the generated workspace file later.
97
+
98
+
**UX trade-offs:**
99
+
100
+
-**One-time window reload** — opening the workspace file causes VS Code to reload the window. This only happens once; after that the workspace file is saved and reloads are not needed.
101
+
-**File on disk** — a `.code-workspace` file is created in your project root. You can commit it to version control (so teammates get the same workspace layout) or add it to `.gitignore`.
102
+
-**No overwrite** — if a `.code-workspace` file already exists (e.g., from a previous run or your own), the extension will not overwrite it. It offers to open the existing file instead.
103
+
-**`files.exclude` containment** — with a `.code-workspace` file, `files.exclude` patterns are scoped to the workspace file rather than `.vscode/settings.json`. This reduces the risk of pattern collisions with project directories (see Known limitations above).
| Same as above, but with a proper project name in the title bar |`workspace: true` + `workspaceFile: true`|
111
+
| Browse vault only via the sidebar tree view (no workspace folder at all) |`workspace: false`|
112
+
82
113
## Related Tools
83
114
84
115
This VSCode extension provides file-system access and UI integration for Obsidian vaults. If you use **Claude Code**, the companion [`@obsidian-vfs/claude-plugin`](https://github.com/otaviof/obsidian-vfs/tree/main/packages/claude-plugin) enables Claude to read and search your vault via `@obs:` mentions and automatically resolves wikilinks in agent definitions and skills.
Copy file name to clipboardExpand all lines: packages/vscode/package.json
+6-1Lines changed: 6 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
"name": "obsidian-vfs",
3
3
"displayName": "Obsidian VFS",
4
4
"description": "Browse, search, and edit your Obsidian vault directly in VSCode via a virtual file system (obs://)",
5
-
"version": "0.3.0",
5
+
"version": "0.3.1",
6
6
"private": true,
7
7
"publisher": "otaviof",
8
8
"engines": {
@@ -128,6 +128,11 @@
128
128
"type": "boolean",
129
129
"default": true,
130
130
"description": "Add the vault as a file:// workspace folder for Quick Open (Cmd+P) and Search (Ctrl+Shift+F). Non-autoMount content is hidden via files.exclude patterns managed by the extension. Requires at least one local folder open and at least one autoMount entry."
131
+
},
132
+
"obsidianVFS.workspaceFile": {
133
+
"type": "boolean",
134
+
"default": false,
135
+
"description": "Generate a .code-workspace file named after the project. Avoids the 'Untitled (Workspace)' label caused by dynamic workspace folder injection. The file contains a file:// vault folder entry and the extension's files.exclude patterns are written to its settings section. Opening the file reloads the window."
0 commit comments