From 1b6c657d1f213262ac73e95ac64143cec0b8b95a Mon Sep 17 00:00:00 2001 From: Abu Abacus Date: Sat, 3 Jan 2026 18:11:19 +0100 Subject: [PATCH] User interface settings and ModeLine --- readme.org | 151 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) diff --git a/readme.org b/readme.org index 9710b88..de874f2 100644 --- a/readme.org +++ b/readme.org @@ -1,5 +1,6 @@ #+TITLE: Emacs configuration #+PROPERTY: header-args:emacs-lisp :tangle init.el +#+STARTUP: overview * Preface @@ -557,3 +558,153 @@ in conjunction with Evil modes. #+end_src +* General configuration +** User Interface + +Clean up Emacs' user interface, make it more minimal. Improve scrolling. + +#+begin_src emacs-lisp + + (setq mouse-wheel-scroll-amount '(3 ((shift) . 1))) ;; one line at a time + (setq mouse-wheel-progressive-speed nil) ;; don't accelerate scrolling + (setq mouse-wheel-follow-mouse 't) ;; scroll window under mouse + (setq scroll-step 1) ;; keyboard scroll one line at a time + (setq use-dialog-box nil) ;; Disable dialog boxes since they weren't working in Mac OSX + +#+end_src + +Set frame transparency (and maximize windows by default). + +#+begin_src emacs-lisp + +; (set-frame-parameter (selected-frame) 'alpha '(90 . 90)) +; (add-to-list 'default-frame-alist '(alpha . (90 . 90))) +; (set-frame-parameter (selected-frame) 'fullscreen 'maximized) +; (add-to-list 'default-frame-alist '(fullscreen . maximized)) + +#+end_src + +Set line spacing. + +#+begin_src emacs-lisp + + (setq line-spacing 0.03) + +#+end_src + +Enable line numbers and customize their format (e.g.: relative numbers). +Also set the width of the line number column. + +#+begin_src emacs-lisp + + (column-number-mode) + + ;; Enable line numbers for some modes + (dolist (mode '(text-mode-hook + prog-mode-hook + conf-mode-hook)) + (add-hook mode (lambda () + (display-line-numbers-mode 1) + (setq display-line-numbers 'relative)))) + + ;; Override some modes which derive from the above + (dolist (mode '(org-mode-hook)) + (add-hook mode (lambda () + (display-line-numbers-mode 1) + (setq display-line-numbers 'relative)))) + + (setq-default display-line-numbers-width 4) + +#+end_src + +Don't warn for large files (shows up when launching videos) +Don't warn for following symlinked files +Don't warn when advice is added for functions + +#+begin_src emacs-lisp + + (setq large-file-warning-threshold nil) + (setq vc-follow-symlinks t) + (setq ad-redefinition-action 'accept) + +#+end_src + +** Theme + +These days I bounce around between themes included with [[https://github.com/hlissner/emacs-doom-themes][DOOM Themes]] since they're +well-designed and integrate with a lot of Emacs packages. + +A nice gallery of Emacs themes can be found at https://emacsthemes.com/. + +Alternate themes: + +- =doom-snazzy= +- =doom-vibrant= + +#+begin_src emacs-lisp + + (setup (:pkg spacegray-theme)) + (setup (:pkg doom-themes)) + + (add-hook 'emacs-startup-hook + (lambda () +; (load-theme 'doom-palenight t) + (doom-themes-visual-bell-config))) + +#+end_src + +** Mode Line + +*** Basic Customization + +#+begin_src emacs-lisp + + (setq display-time-format "%l:%M %p %b %y" + display-time-default-load-average nil) + +#+end_src + +*** Enable Mode Diminishing + +The [[https://github.com/myrjola/diminish.el][diminish]] package hides pesky minor modes from the modelines. + +#+begin_src emacs-lisp + + (setup (:pkg diminish)) + +#+end_src + +*** Doom Modeline + +#+begin_src emacs-lisp + + ;; You must run (nerd-icons-install-fonts) one time after + ;; installing this package! + + (setup (:straight minions) + (:hook-into doom-modeline-mode)) + + (setup (:pkg shrink-path)) + + (setup (:pkg doom-modeline) + (:hook-into after-init-hook) + + (:option doom-modeline-height 21 + doom-modeline-bar-width 6 + doom-modeline-lsp t + doom-modeline-github nil + doom-modeline-mu4e nil + doom-modeline-irc t + doom-modeline-modal-icon nil + doom-modeline-minor-modes t + doom-modeline-persp-name nil + doom-modeline-buffer-file-name-style 'truncate-except-project + doom-modeline-major-mode-icon nil) + (:face mode-line ((t (:height 0.95)))) + (:face mode-line-inactive ((t (:height 0.95))))) + + ; (setq doom-modeline-display-default-persp-name nil) + ; (setq doom-modeline-persp-name nil) + +#+end_src +