arasan9581 downloadsDesignate one pane as your "Main Pane" and route file opens (links, switcher, explorer, search, backlinks, graph, new notes, and more) to that pane.
Designate one pane as your Main Pane, and route file-open operations to it.
In a common setup the workspace is split left/right:
Main Pane redirects opens so that, wherever you open (links, Quick Switcher, File Explorer, Search, Backlinks, Graph, Command Palette, new notes, other plugins, …), the file opens up in your chosen Main Pane.
Main Pane: Set Current Pane as Main Pane, Main Pane: Clear Main Pane)
plus buttons in the settings tab.◉ status-bar indicator (or run Main Pane: Toggle
Redirect to Main Pane) to switch redirect off; the opened note then stays
where it was opened. Click again to turn redirect back on.◉ Main Pane badge on
the pane, plus a status bar icon. Toggleable (Settings → Indicator → Show indicator).Obsidian 1.13+ funnels essentially every file-open surface through
WorkspaceLeaf.openFile() (links resolve to it via workspace.openLinkText
→ leaf.openLinkText, and the File Explorer, Search, Backlinks, Graph,
Quick Switcher, new notes, and other plugins call it directly). The plugin
uses two official mechanisms:
WorkspaceLeaf.openFile is wrapped. When Obsidian is
about to navigate a leaf outside the Main Pane, the file is opened in a
new tab of the Main Pane instead, with the original state/eState
preserved.Workspace.getLeaf("tab" | true) is wrapped: the
Main Pane's leaf is briefly marked as the most recent one, so Obsidian's
own "new tab" logic creates the tab inside the Main Pane's tab strip.Split and pop-out opens (getLeaf("split" | "window"), i.e. Alt+click /
Cmd+Shift+Alt+click) are tagged and passed through natively. In-note
[[#heading]] navigation stays in the pane it was clicked in. On unload the
original methods are restored.
When a sidebar view (Backlinks, Search, Graph, …) is active, Obsidian's plain open first creates an empty leaf inside that sidebar's tab strip; that leftover empty tab is detached again after the open lands in the Main Pane.
The Main Pane is a tab strip, not a note. When its last note tab is closed, the plugin opens an empty placeholder tab first so Obsidian does not destroy the pane (and the designation with it). Closing the placeholder itself closes the pane and clears the designation. With Auto-select a new Main Pane on, the pane is allowed to close and the most recently used pane is promoted instead.
Not set).◉ Main Pane badge inside the pane.◉ icon in the status bar (clicking it
still toggles redirect mode).Requirements: Node.js ≥ 18, npm.
npm install # install dependencies
npm run dev # watch mode → rebuilds main.js on change
npm run build # type-check + production bundle (main.js)
npm run typecheck # TypeScript check only
Output: main.js (esbuild, CommonJS, targets ES2021). styles.css and
manifest.json are copied unchanged.
<vault>/.obsidian/plugins/main-pane/ (the folder
name must match the plugin id main-pane).Main Pane: Set Current Pane as Main Pane from the Command Palette.To update the plugin after a change, run npm run build, copy the new
main.js, and reload Obsidian.
◉ indicator (status bar) and the pane outline to know where
opens will go. Click ◉ to toggle redirect mode on/off.When redirect mode is OFF, opens stay exactly where Obsidian would put them; the Main Pane designation and indicator remain so you can turn it back on with one click.
Not set
(re-promote via the auto-select option or the command) instead of erroring.openFile calls, which are re-routed when the corresponding setting is on.
Nothing in their settings or internals is touched.WorkspaceLeaf.openFile,
WorkspaceLeaf.detach, and Workspace.getLeaf; there is nothing left
behind.main.js targets Obsidian 1.5.1+ (getLeafById); the routing relies on
behavior present in Obsidian 1.13+.isDesktopOnly: false; desktop is the primary target — mobile pane
behavior (drawers, pop-outs) varies.Improvements welcome. Please keep the "official-API only, no destructive hack" rule and document any new limitation in this README.
MIT — see LICENSE.