Taming Org-Mode With Side Windows
Org-mode will, occasionally, pop up a window that takes over half the screen. Specifically, this happens to when:
- Capturing a note (
org-capture
): I get a half-screen window asking me to select the capture template. - Inserting a timestamp (
org-timestamp
): The calendar takes over half the screen (assumingorg-read-date-popup-calendar
is non-nil).
This is especially annoying in the second case because the calendar window invariably covers the window I’m referencing while taking notes. That is, I usually take notes with the following setup where the red window is the selected window and the gray window is some document I’m referencing.
In this case, attempting to insert a timestamp in my notes causes a calendar window to pop-up, covering the reference window:
The solution is to use side windows. E.g., I can put the calendar at the top of the screen above the notes/reference windows, replacing neither.
First, put calendar windows in a dedicated side-window at the top of the screen.
(setf (alist-get (rx bos "*Calendar*" eos) display-buffer-alist nil nil #'equal)
'(display-buffer-in-side-window (side . top) (dedicated . t)
(window-height . fit-window-to-buffer)))
Then, put org-capture template selection buffers in a side-window at the bottom of the screen, instead of taking over half the screen.
(setf (alist-get (rx bos "*Org Select* eos) display-buffer-alist #nil nil 'equal)
'(display-buffer-in-side-window (dedicated . t)))
If you want to better understand Emacs window management, I highly recommend Mickey’s (of Mastering Emacs) excellent write up: Demystifying Emacs’s Window Manager.