diff options
-rw-r--r-- | .config/emacs/init.el | 30 | ||||
-rw-r--r-- | .config/emacs/modules/mm-window.el | 72 |
2 files changed, 74 insertions, 28 deletions
diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 8726462..d8997fe 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -177,7 +177,6 @@ buffer suppressed." (echo-keystrokes 0.01) ; 0 disables echoing (echo-keystrokes-help nil) (extended-command-suggest-shorter nil) - (help-window-select t) (initial-buffer-choice t) (initial-scratch-message mm-initial-scratch-message) (kill-do-not-save-duplicates t) @@ -190,18 +189,13 @@ buffer suppressed." (remote-file-name-inhibit-delete-by-moving-to-trash t) (require-final-newline nil) (save-interprogram-paste-before-kill t) - (scroll-conservatively 101) ; (info "(Emacs)Auto Scrolling") - (scroll-error-top-bottom t) - (scroll-margin 10) (user-full-name "Thomas Voss") (user-mail-address "mail@thomasvoss.com") (vc-follow-symlinks t) (vc-handled-backends '(Git)) :config (load custom-file :noerror) - (setq-default - fill-column 80 - truncate-partial-width-windows nil) + (setq-default fill-column 80) (dolist (mode '(text-mode emacs-lisp-mode lisp-mode)) (add-hook (mm-mode-to-hook mode) (defun mm-set-fill-column () @@ -230,16 +224,6 @@ buffer suppressed." (show-paren-delay 0)) -;;; Display Line Numbers - -(use-package display-line-numbers - :hook prog-mode - :custom - (display-line-numbers-type 'relative) - (display-line-numbers-width-start 99) - (display-line-numbers-grow-only t)) - - ;;; Auto Revert Buffers (use-package autorevert @@ -260,17 +244,6 @@ buffer suppressed." (bookmark-save-flag 1)) -;;; Smoother Scrolling - -(use-package pixel-scroll - :init - (pixel-scroll-precision-mode) - :config - ;; Make it easier to use custom scroll functions - (dolist (binding '("<next>" "<prior>")) - (keymap-unset pixel-scroll-precision-mode-map binding :remove))) - - ;;; Automatically Create- and Delete Directories (defun mm-auto-create-directories (function filename &rest arguments) @@ -340,6 +313,7 @@ the buffer without saving it." (require 'mm-tetris) ; Emacs Tetris (require 'mm-theme) ; Themeing (require 'mm-treesit) ; Tree-Sitter +(require 'mm-window) ; Windowing (when mm-darwin-p (require 'mm-darwin)) ; MacOS (when mm-lsp-p 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 (("<f1>" . 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 ("<f2>" . 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 '("<next>" "<prior>")) + (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 |