links · 11m

Links, IDs, and attachments

A fuzzy link searches the current document. An Org ID survives a rename.

Three ways to point at the same heading

Fuzzy[[release plan]]Cheap inside one file. Breaks if you rename the title.
CUSTOM_ID[[#method]]Readable HTML anchors. You keep them unique.
Org IDid:6f2c8f52-…Survives a rename and a move across files.

Org links use [[target][description]] or [[target]]. C-c C-l inserts or edits a link; C-c C-o (org-open-at-point) follows one. A fuzzy link searches the current document for a target, heading, named element, or dedicated target. File links may include search options.

For stable public anchors, add CUSTOM_ID. An Org ID is a globally unique identifier managed through Org's ID system. M-x org-id-get-create creates one; org-id-find can resolve it using known ID locations. IDs survive heading renames and are preferable for long-lived cross-file references. CUSTOM_ID is human-chosen and especially useful in exported URLs; uniqueness is your responsibility.

Attachments associate files with a heading. C-c C-a opens the org-attach dispatcher. Org can use a local DIR property or an ID-derived store controlled by org-attach-id-dir. Copying, moving, opening, and synchronizing attachments should go through the dispatcher when possible so metadata and files stay aligned.

Choose attachment storage deliberately. A sibling directory is transparent and easy to publish. ID-based storage survives heading renames but produces opaque paths. Git handles small images and text well; large binaries inflate history. Sync tools can conflict if an attachment and its Org reference move concurrently.

Summary. Choose the cheapest durable reference that still works after you move the heading. Attachments should travel with the dispatcher, not by hand.

Exercises

  • Basic: Link from projects.org to a heading in notes.org.
  • Practical: Give a durable research heading an ID and link to it.
  • Advanced: Attach a small image, inspect the generated storage, then decide whether it belongs in Git.