From 8a7ebce5c536141264511a6bcb4692383c18ab14 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sun, 1 Dec 2024 11:08:41 +0100 Subject: emacs: Add a windowing module --- .config/emacs/modules/mm-window.el | 72 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .config/emacs/modules/mm-window.el (limited to '.config/emacs/modules') diff --git a/.config/emacs/modules/mm-window.el b/.config/emacs/modules/mm-window.el new file mode 100644 index 0000000..0ce77c7 --- /dev/null +++ b/.config/emacs/modules/mm-window.el @@ -0,0 +1,72 @@ +;;; mm-window.el --- Window configurations -*- lexical-binding: t; -*- + + +;;; Unique Buffer Names + +(use-package uniquify + :custom + (uniquify-buffer-name-style 'forward)) + + +;;; Highlight Whitespace + +(use-package whitespace + :bind (("" . whitespace-mode) + ("C-c z" . delete-trailing-whitespace)) + :custom + (whitespace-style + '( face trailing spaces tabs space-mark tab-mark empty indentation + space-after-tab space-before-tab)) + (whitespace-display-mappings + '((space-mark 32 [?·] [?.]) ; Space + (space-mark 160 [?␣] [?_]) ; Non-Breaking Space + (tab-mark 9 [?» ?\t] [?> ?\t])))) + + +;;; Line Numbers + +(use-package display-line-numbers + :bind ("" . display-line-numbers-mode) + :custom + (display-line-numbers-grow-only t) + (display-line-numbers-type 'relative) + (display-line-numbers-width-start 99)) + + +;;; Select Help Windows + +(use-package help + :custom + (help-window-select t)) + + +;;; Window Scrolling + +(use-package window + :custom + (scroll-conservatively 101) ; (info "(Emacs)Auto Scrolling") + (scroll-error-top-bottom t) + (scroll-margin 10) + :config + (setq-default truncate-partial-width-windows nil)) + + +;;; Smoother Scrolling + +(mm-comment + (use-package pixel-scroll + :init + (pixel-scroll-precision-mode) + :config + ;; Make it easier to use custom scroll functions + (dolist (binding '("" "")) + (keymap-unset pixel-scroll-precision-mode-map binding :remove)))) + + +;;; Ace Window + +(use-package ace-window + :ensure t + :bind ("M-o" . ace-window)) + +(provide 'mm-window) \ No newline at end of file -- cgit v1.2.3