All Projects → cyrus-and → Zoom

cyrus-and / Zoom

Fixed and automatic balanced window layout for Emacs

Projects that are alternatives of or similar to Zoom

Deft
Deft for Emacs
Stars: ✭ 521 (+106.75%)
Mutual labels:  emacs, emacs-mode
Nyan Mode
Nyan Cat for Emacs! Nyanyanyanyanyanyanyanyanyan!
Stars: ✭ 590 (+134.13%)
Mutual labels:  emacs, emacs-mode
Writegood Mode
Minor mode for Emacs to improve English writing
Stars: ✭ 369 (+46.43%)
Mutual labels:  emacs, emacs-mode
Swift Mode
Emacs support for Apple's Swift programming language.
Stars: ✭ 308 (+22.22%)
Mutual labels:  emacs, emacs-mode
Jq Mode
Emacs major mode for editing jq queries.
Stars: ✭ 70 (-72.22%)
Mutual labels:  emacs, emacs-mode
Clj Refactor.el
A collection of Clojure refactoring functions for Emacs
Stars: ✭ 694 (+175.4%)
Mutual labels:  emacs, emacs-mode
Live Py Plugin
Live coding in Python with PyCharm, Emacs, Sublime Text, or even a browser
Stars: ✭ 222 (-11.9%)
Mutual labels:  emacs, emacs-mode
Psc Ide Emacs
Emacs integration for PureScript's psc-ide tool.
Stars: ✭ 130 (-48.41%)
Mutual labels:  emacs, emacs-mode
Webpaste.el
webpaste.el can paste whole buffers or parts of buffers to several pastebin-like services and supports failover if one service fails.
Stars: ✭ 67 (-73.41%)
Mutual labels:  emacs, emacs-mode
Fingers.el
Modal editing minor mode for Emacs
Stars: ✭ 51 (-79.76%)
Mutual labels:  emacs, emacs-mode
Emacs Solidity
The official solidity-mode for EMACS
Stars: ✭ 120 (-52.38%)
Mutual labels:  emacs, emacs-mode
Org Msg
OrgMsg is a GNU/Emacs global minor mode mixing up Org mode and Message mode to compose and reply to emails in a Outlook HTML friendly style.
Stars: ✭ 153 (-39.29%)
Mutual labels:  emacs, emacs-mode
Engine Mode
Minor mode for defining and querying search engines through Emacs.
Stars: ✭ 225 (-10.71%)
Mutual labels:  emacs
Emacs Easy Hugo
Emacs major mode for managing hugo
Stars: ✭ 235 (-6.75%)
Mutual labels:  emacs
Wakatime Mode
Emacs plugin for automatic time tracking and metrics generated from your programming activity.
Stars: ✭ 225 (-10.71%)
Mutual labels:  emacs
Docker Emacs
Dockerized Emacs (GUI)
Stars: ✭ 224 (-11.11%)
Mutual labels:  emacs
Evil Org Mode
Supplemental evil-mode keybindings to emacs org-mode
Stars: ✭ 241 (-4.37%)
Mutual labels:  emacs
Emacs Wsl
Install and run Emacs with the Windows Subsystem for Linux (WSL) in Windows 10.
Stars: ✭ 234 (-7.14%)
Mutual labels:  emacs
Bufler.el
A butler for your buffers. Group buffers into workspaces with programmable rules, and easily switch to and manipulate them.
Stars: ✭ 222 (-11.9%)
Mutual labels:  emacs
Awesome Elisp
A curated list of emacs-lisp development resources
Stars: ✭ 221 (-12.3%)
Mutual labels:  emacs

MELPA Stable MELPA

Zoom

This 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.

Screencast

Installation

MELPA package

M-x package-install RET zoom

Local package

M-x package-install-file RET /path/to/zoom.el

Manual

(require 'zoom "/path/to/zoom.el")

Usage

Enable Zoom with M-x zoom-mode otherwise use M-x zoom to manually rearrange windows just once.

Load it automatically with:

(custom-set-variables
 '(zoom-mode t))

See the FAQ.

Example configurations

For a complete reference see M-x customize-group RET zoom.


Resize the selected window using the golden ratio:

(custom-set-variables
 '(zoom-size '(0.618 . 0.618)))

Resize the selected window according to the frame width, for example:

  • 90 columns and 75% of the frame height if the frame width is larger than 1024 pixels;
  • half the frame size otherwise.
(defun size-callback ()
  (cond ((> (frame-pixel-width) 1280) '(90 . 0.75))
        (t                            '(0.5 . 0.5))))

(custom-set-variables
 '(zoom-size 'size-callback))

Override the key binding of balance-windows:

(global-set-key (kbd "C-x +") 'zoom)

Prevent some windows from being resized, for example:

  • dired and markdown major modes;
  • zoom.el init.el buffer names;
  • calculator-related windows;
  • any buffer containing less than 20 lines.
(custom-set-variables
 '(zoom-ignored-major-modes '(dired-mode markdown-mode))
 '(zoom-ignored-buffer-names '("zoom.el" "init.el"))
 '(zoom-ignored-buffer-name-regexps '("^*calc"))
 '(zoom-ignore-predicates '((lambda () (> (count-lines (point-min) (point-max)) 20)))))

(Please note that ignored windows are not resized when selected but all the windows are nevertheless arranged with balance-windows.)

FAQ

What about golden-ratio.el?

I 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.

Why when there are several horizontal splits the completions buffer is very small?

This 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:

(custom-set-variables
 '(temp-buffer-resize-mode t))

Why windows are resized even when they are ignored?

When a window is ignored it is simply not resized when the user selects it.

In order to maintain a stable layout, windows are always balanced, then the selected window, unless ignored, is zoomed according to the user preference.

This may cause weird layouts with windows that are designed to be small, e.g., imenu-list. Unfortunately there is no universal solution to this.

The 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:

(defun my/fix-imenu-size ()
  (with-selected-window (get-buffer-window "*Ilist*")
    (setq window-size-fixed t)
    (window-resize (selected-window) (- 30 (window-total-width)) t t)))

(add-hook 'imenu-list-update-hook 'my/fix-imenu-size)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].