Hi all,

I'd like to announce org-win-find-file, a small package that adds a new
"win:" org link type for opening one or more files or org links in a
freshly built, possibly nested window layout.

The link path is a small expression built from targets and two split
operators:

  |   horizontal split -- windows placed side by side
  ÷   (division sign) vertical split   -- windows stacked top to bottom

Parentheses group sub-layouts, and each target can itself be a plain file
path or another org link (opened through org's own link machinery). Targets
can also carry a suffix of window options
(sticky, focus, read-only, no-other-window, auto-revert, fit-to-buffer,
explicit size), written between guillemets right after the target.

A few examples:

  [[win:info:emacs#Windows]]
      Open the "Windows" node of the Emacs manual in a single window.

  [[win:info:emacs#Windows|info:emacs#Frames]]
      Two windows side by side.

  [[win:info:emacs#Windows«s,f»|doc.org«r,w=40%»]]
      The "Windows" node sticky and focused on the left; doc.org
      read-only on the right, sized to 40% of the split.

  [[win:foo.bar÷(wuz.bar|maz.bar)]]
      foo.bar on top; below it wuz.bar and maz.bar side by side.

I found this useful for org files that link out to a fixed set of related
buffers (e.g. a project's main file plus a couple of logs or notes) that I
want to reopen in the same arrangement every time.

The code is here:

  https://github.com/dov/org-win-find-file

It's not yet on MELPA, but a recipe PR is in progress. Until then, just
clone the repo and add it to your load-path.

Feedback, bug reports, and pull requests are welcome.

Note: this package was written with AI assistance.

Regards,
Dov

Reply via email to