Copy as Zed Link

approved

by Santuzius

Select contents in Obsidian and link them into your agent panel in the Zed editor. - This plugin has not been manually reviewed by Obsidian staff.

53 downloadsUpdated 28d agoMIT

Copy as Zed Link

Copy a passage, a note, or a folder as a link that Zed's agent panel embeds as context. Paste it there and the contents show up as an attachment rather than a bare link.

Quick start

  1. Install the plugin (desktop only) and enable it.
  2. Select some lines, right-click, choose Copy as Zed link, and paste into Zed's agent panel.

That's all. If Zed is installed and its CLI is available, the plugin reaches it automatically. If something goes wrong, see the CLI docs and check the plugin's settings — or skip the CLI and set up your project manually, see below.

Copying

  • A passage — select the lines, then right-click → Copy as Zed link, or run the command of the same name (worth a hotkey).
  • A file or folder — right-click it in the file explorer → Copy file as Zed link / Copy folder as Zed link.
  • The current note — run Copy whole file as Zed link.

Platform support

Developed and tested on Linux. macOS and Windows should work, and so should a Flatpak Zed by setting Zed command to flatpak run dev.zed.Zed, but none of those are tested.

What lands on the clipboard

A Markdown link to the file on disk: a line span for a passage, nothing for a whole note, a trailing slash for a folder.

[@My Note.md (122:123)](file:///home/me/vault/My%20Note.md#L122:123)
[@My Note.md](file:///home/me/vault/My%20Note.md)
[@Projects](file:///home/me/vault/Projects/)

Why a link sometimes does not resolve

Zed resolves a mention through the open project. A link to something outside it fails with project path not found for file mention. Two ways around that:

  • Let the plugin open it — with Use Zed CLI on, the target is handed to the Zed CLI just before the link is copied, so it joins the project without the whole vault coming along. Zed comes to the front when it does, and if Zed is not already running it starts with just that file, so open your project first.
  • Add the vault yourselfFile → Add Folder to Project… in Zed, once per project. If you would rather not, paste the link with Paste as Plain Text; an agent with filesystem access should understand the raw format even without the embedding.

Settings

Setting
Use Zed CLIHand the target to the Zed CLI before copying. Switches itself on whenever the command answers.
Zed commandHow to run the CLI: zed, /usr/local/bin/zed, flatpak run dev.zed.Zed, zed.exe. The button tests it. On macOS, run zed: install cli in Zed once if zed is missing.
Open files inThe existing window, the current workspace, or a new window.
Jump to the selected linePut Zed's cursor on the first line of the selection.
Open folders inThe current workspace, a new workspace, or a new window. A folder becomes a worktree, so it cannot join the existing window the way a file does.
Folder links addA folder mention needs the folder in the project: the whole vault by default, so one copy is enough for every later link, or just that folder.
Remind me about the Zed projectExplain once per session why a link copied without the CLI may not resolve.

If the command stops answering, the plugin turns Use Zed CLI off and says so. It comes back on by itself once the command answers again; switching it off by hand is remembered.

Installation

Desktop only, since the link has to name a real path on disk.

Install from Settings → Community plugins → Browse, or, for a version that is not in the catalogue yet, point BRAT at Santuzius/copy-as-zed-link.

To install by hand, take main.js and manifest.json from the latest release and drop them into <vault>/.obsidian/plugins/copy-as-zed-link/.

License

MIT

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.