From 7b81bc23dca79b04f5394f97f5477ce3dbbdb22b Mon Sep 17 00:00:00 2001 From: Joe Frikker Date: Thu, 22 Jan 2026 16:36:51 -0500 Subject: [PATCH] Moving window placement around --- home.org | 102 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 55 insertions(+), 47 deletions(-) diff --git a/home.org b/home.org index d29d2a1..87ec441 100644 --- a/home.org +++ b/home.org @@ -827,6 +827,61 @@ move backward / forward through history. "" #'tab-bar-history-forward)) #+END_SRC +** Window Placement +This section contains rules about where ~display-buffer~ should place windows. I guess I'm currently +going for an IDE-style layout, with one main editor window, and auxiliary bottom and right side +windows. I place windows in the bottom or on the right mostly depending on how wide I expect their +content to be. + +#+BEGIN_SRC elisp :noweb no :noweb-ref emacs_config + (cl-flet ((defbottom (&optional (slot 1)) + (lambda (rule) + `(,rule + (display-buffer-reuse-window display-buffer-in-side-window) + (side . bottom) + (slot . ,slot) + (window-height . 0.33) + (window-parameters (no-delete-other-windows . t))))) + (defright (&optional (slot 0)) + (lambda (rule) + `(,rule + (display-buffer-reuse-window display-buffer-in-side-window) + (side . right) + (slot . ,slot) + (window-width . 0.5) + (window-parameters (no-delete-other-windows . t))))) + (defall (def &rest rules) + (mapcar (lambda (rule) (funcall def rule)) rules))) + (let* ((bottom-window-params '((side . bottom) + (slot . 1) + (window-height . 0.33) + (window-parameters (no-delete-other-windows . t)))) + (right-window-params '((side . right) + (window-width . 0.5) + (window-parameters (no-delete-other-windows . t)))) + (right-window-slot-1-params (cons '(slot . 1) right-window-params))) + (setopt display-buffer-alist + (append + (defall (defbottom) + "\\*Flymake diagnostics *" + "\\*Embark Export *" + "\\*Embark Collect *" + "\\*xref*" + "\\*compilation\\*" + "\\*sly-mrepl *" + "\\*Messages\\*" + "\\*lispy-message\\*" + "\\*EGLOT connections\\*" + "\\*trace-output\\*" + "\\*occur\\*") + (defall (defright) + "magit: *" + "magit-revision: *" + "\\*eldoc\\*" + "\\*Help\\*") + (defall (defright -1) + "\\*Embark Actions\\*"))))) +#+END_SRC ** Editing This configuration affects general text editing, across all modes. First, some packages: @@ -1171,53 +1226,6 @@ available? It seems to work for now anyway... 'eglot-list-connections-mode-hook)) (add-hook hook 'tab-line-mode)) - (cl-flet ((defbottom (&optional (slot 1)) - (lambda (rule) - `(,rule - (display-buffer-reuse-window display-buffer-in-side-window) - (side . bottom) - (slot . ,slot) - (window-height . 0.33) - (window-parameters (no-delete-other-windows . t))))) - (defright (&optional (slot 0)) - (lambda (rule) - `(,rule - (display-buffer-reuse-window display-buffer-in-side-window) - (side . right) - (slot . ,slot) - (window-width . 0.5) - (window-parameters (no-delete-other-windows . t))))) - (defall (def &rest rules) - (mapcar (lambda (rule) (funcall def rule)) rules))) - (let* ((bottom-window-params '((side . bottom) - (slot . 1) - (window-height . 0.33) - (window-parameters (no-delete-other-windows . t)))) - (right-window-params '((side . right) - (window-width . 0.5) - (window-parameters (no-delete-other-windows . t)))) - (right-window-slot-1-params (cons '(slot . 1) right-window-params))) - (setopt display-buffer-alist - (append - (defall (defbottom) - "\\*Flymake diagnostics *" - "\\*Embark Export *" - "\\*Embark Collect *" - "\\*xref*" - "\\*compilation\\*" - "\\*sly-mrepl *" - "\\*Messages\\*" - "\\*lispy-message\\*" - "\\*EGLOT connections\\*" - "\\*trace-output\\*") - (defall (defright) - "magit: *" - "magit-revision: *" - "\\*eldoc\\*" - "\\*Help\\*") - (defall (defright -1) - "\\*Embark Actions\\*"))))) - (setq ediff-split-window-function 'split-window-horizontally) #+END_SRC