From 422178a615c31b43678a5afed7c1854681500886 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Wed, 15 Nov 2023 09:47:27 +0000 Subject: [PATCH] Replace window splitting rules with shackle package --- home/emacs/default.nix | 1 + home/emacs/init.el | 15 +++++++++------ home/emacs/init.org | 23 +++++++++++++---------- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/home/emacs/default.nix b/home/emacs/default.nix index c3357775..6e708090 100644 --- a/home/emacs/default.nix +++ b/home/emacs/default.nix @@ -78,6 +78,7 @@ which-key link-hint darkroom + shackle # writing-packages markdown-mode diff --git a/home/emacs/init.el b/home/emacs/init.el index d673ed69..9f9970c2 100644 --- a/home/emacs/init.el +++ b/home/emacs/init.el @@ -7,6 +7,7 @@ use-short-answers t load-prefer-newer t indent-tabs-mode nil + even-window-sizes nil global-auto-revert-non-file-buffers t dired-auto-revert-buffer t dired-dwim-target t @@ -45,11 +46,6 @@ ;; Make shebang (#!) file executable when saved (add-hook 'after-save-hook #'executable-make-buffer-file-executable-if-script-p) -(setq even-window-sizes nil - display-buffer-base-action '((display-buffer-reuse-window - display-buffer-same-window) - (reusable-frames . t))) - (when (require 'package nil :noerror) (add-to-list 'package-archives '("stable" . "https://stable.melpa.org/packages/")) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) @@ -100,7 +96,7 @@ (menu-bar-mode -1) (tool-bar-mode -1) (scroll-bar-mode -1) -(tab-bar-mode +1) +(tab-bar-mode -1) (line-number-mode +1) (column-number-mode +1) (global-display-line-numbers-mode -1) @@ -243,6 +239,13 @@ :ensure t :bind (("C-c d" . darkroom-mode))) +(setq shackle-rules '((compilation-mode :noselect t) + (mu4e-main-mode :same t :inhibit-window-quit t)) + shackle-default-rule '(:select t)) +(use-package shackle + :ensure t + :config (shackle-mode +1)) + (setq org-directory "~/Org" org-default-notes-file (expand-file-name "notes.org" org-directory) org-pretty-entities-include-sub-superscripts t diff --git a/home/emacs/init.org b/home/emacs/init.org index c27b221e..83f641a3 100644 --- a/home/emacs/init.org +++ b/home/emacs/init.org @@ -15,6 +15,7 @@ use-short-answers t load-prefer-newer t indent-tabs-mode nil + even-window-sizes nil global-auto-revert-non-file-buffers t dired-auto-revert-buffer t dired-dwim-target t @@ -54,15 +55,6 @@ (add-hook 'after-save-hook #'executable-make-buffer-file-executable-if-script-p) #+END_SRC -** Control window splitting -#+begin_src emacs-lisp - (setq even-window-sizes nil - display-buffer-base-action '((display-buffer-reuse-window - display-buffer-same-window) - (reusable-frames . t))) -#+end_src - - ** package-archive with priorities #+begin_src emacs-lisp :results output silent (when (require 'package nil :noerror) @@ -129,7 +121,7 @@ (menu-bar-mode -1) (tool-bar-mode -1) (scroll-bar-mode -1) - (tab-bar-mode +1) + (tab-bar-mode -1) (line-number-mode +1) (column-number-mode +1) (global-display-line-numbers-mode -1) @@ -284,6 +276,17 @@ :ensure t :bind (("C-c d" . darkroom-mode))) #+end_src + +** Shackle +#+begin_src emacs-lisp + (setq shackle-rules '((compilation-mode :noselect t) + (mu4e-main-mode :same t :inhibit-window-quit t)) + shackle-default-rule '(:select t)) + (use-package shackle + :ensure t + :config (shackle-mode +1)) +#+end_src + * Org-mode For reference information, see [[https://orgmode.com][Org-mode website]]