{"id":13646423,"url":"https://github.com/cyrus-and/zoom","last_synced_at":"2025-04-06T22:08:37.420Z","repository":{"id":55645510,"uuid":"105956131","full_name":"cyrus-and/zoom","owner":"cyrus-and","description":"Fixed and automatic balanced window layout for Emacs","archived":false,"fork":false,"pushed_at":"2023-11-09T19:50:07.000Z","size":49,"stargazers_count":341,"open_issues_count":1,"forks_count":16,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-02-17T07:35:21.569Z","etag":null,"topics":["emacs","emacs-customizations","emacs-lisp","emacs-mode","golden-ratio","window-management"],"latest_commit_sha":null,"homepage":null,"language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cyrus-and.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-06T01:11:59.000Z","updated_at":"2024-05-30T01:27:20.768Z","dependencies_parsed_at":"2024-05-30T01:27:20.382Z","dependency_job_id":"e2f96e75-de6e-4de4-86c6-553aff101453","html_url":"https://github.com/cyrus-and/zoom","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrus-and%2Fzoom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrus-and%2Fzoom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrus-and%2Fzoom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrus-and%2Fzoom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cyrus-and","download_url":"https://codeload.github.com/cyrus-and/zoom/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247557767,"owners_count":20958047,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["emacs","emacs-customizations","emacs-lisp","emacs-mode","golden-ratio","window-management"],"created_at":"2024-08-02T01:02:55.219Z","updated_at":"2025-04-06T22:08:37.403Z","avatar_url":"https://github.com/cyrus-and.png","language":"Emacs Lisp","funding_links":[],"categories":["Emacs Lisp"],"sub_categories":[],"readme":"[![MELPA Stable](https://stable.melpa.org/packages/zoom-badge.svg)](https://stable.melpa.org/#/zoom)\n[![MELPA](https://melpa.org/packages/zoom-badge.svg)](https://melpa.org/#/zoom)\n\n# Zoom\n\nThis minor mode takes care of managing the window sizes by enforcing a fixed and automatic balanced layout where the currently selected window is resized according to `zoom-size` which can be an absolute value in lines/columns, a ratio between the selected window and frame size or even a custom callback.\n\n![Screencast](https://i.imgur.com/joZxu56.gif)\n\n## Installation\n\n### [MELPA] package\n\n```\nM-x package-install RET zoom\n```\n\n[MELPA]: https://melpa.org/#/getting-started\n\n### Local package\n\n```\nM-x package-install-file RET /path/to/zoom.el\n```\n\n### Manual\n\n```el\n(require 'zoom \"/path/to/zoom.el\")\n```\n\n## Usage\n\nEnable Zoom with `M-x zoom-mode` otherwise use `M-x zoom` to manually rearrange windows just once.\n\nLoad it automatically with:\n\n```el\n(custom-set-variables\n '(zoom-mode t))\n```\n\nSee the [FAQ].\n\n[FAQ]: https://github.com/cyrus-and/zoom#faq\n\n## Example configurations\n\nFor a complete reference see `M-x customize-group RET zoom`.\n\n---\n\nResize the selected window using the [golden ratio]:\n\n```el\n(custom-set-variables\n '(zoom-size '(0.618 . 0.618)))\n```\n\n[golden ratio]: https://en.wikipedia.org/wiki/Golden_ratio\n\n---\n\nResize the selected window according to the frame width, for example:\n\n- 90 columns and 75% of the frame height if the frame width is larger than 1024 pixels;\n- half the frame size otherwise.\n\n```el\n(defun size-callback ()\n  (cond ((\u003e (frame-pixel-width) 1280) '(90 . 0.75))\n        (t                            '(0.5 . 0.5))))\n\n(custom-set-variables\n '(zoom-size 'size-callback))\n```\n\n---\n\nOverride the key binding of `balance-windows`:\n\n```el\n(global-set-key (kbd \"C-x +\") 'zoom)\n```\n\n---\n\nPrevent some windows from being resized, for example:\n\n- `dired` and `markdown` major modes;\n- `zoom.el` `init.el` buffer names;\n- calculator-related windows;\n- any buffer containing less than 20 lines.\n\n```el\n(custom-set-variables\n '(zoom-ignored-major-modes '(dired-mode markdown-mode))\n '(zoom-ignored-buffer-names '(\"zoom.el\" \"init.el\"))\n '(zoom-ignored-buffer-name-regexps '(\"^*calc\"))\n '(zoom-ignore-predicates '((lambda () (\u003e (count-lines (point-min) (point-max)) 20)))))\n```\n\n(Please note that ignored windows are not resized when selected but all the windows are nevertheless arranged with `balance-windows`.)\n\n## FAQ\n\n### What about [`golden-ratio.el`]?\n\nI have been a more or less happy [`golden-ratio.el`] user for some time when I stared noticing some bugs and sadly I discovered that it is apparently a dead project now, so I decided to write a new and improved minor mode from scratch that implements the same basic idea of automatic window layout as my first attempt at Emacs mode development.\n\n[`golden-ratio.el`]: https://github.com/roman/golden-ratio.el\n\n### Why when there are several horizontal splits the completions buffer is very small?\n\nThis happens when `zoom-minibuffer-preserve-layout` is non-`nil` (the default) because most of the space is probably occupied by the zoomed window. The solution (apart from setting the aforementioned variable to `nil`) is to enable the `temp-buffer-resize-mode` minor mode:\n\n```el\n(custom-set-variables\n '(temp-buffer-resize-mode t))\n```\n\n### Why windows are resized even when they are ignored?\n\nWhen a window is ignored it is simply not resized when the user selects it.\n\nIn order to maintain a *stable* layout, windows are always balanced, then the selected window, unless ignored, is zoomed according to the user preference.\n\nThis may cause weird layouts with windows that are designed to be *small*, e.g., `imenu-list`. Unfortunately there is no universal solution to this.\n\nThe workaround is to set `window-size-fixed` to `t` for the buffers whose window must preserve the current size, for example the following fixes the size of the [`imenu-list`] window to 30 columns:\n\n```el\n(defun my/fix-imenu-size ()\n  (with-selected-window (get-buffer-window \"*Ilist*\")\n    (setq window-size-fixed t)\n    (window-resize (selected-window) (- 30 (window-total-width)) t t)))\n\n(add-hook 'imenu-list-update-hook 'my/fix-imenu-size)\n```\n\n[`imenu-list`]: https://github.com/bmag/imenu-list\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyrus-and%2Fzoom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyrus-and%2Fzoom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyrus-and%2Fzoom/lists"}