My .emacs configuration

My emacs configuration changes every now and then, so rather than a blogpost, I'm just keeping a recent copy here.

;;; -*- lexical-binding: t -*-
;; GUI
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode t)

;; Options
(setq inhibit-startup-screen 1)
(setq display-line-numbers-major-tick 10)
(setq make-backup-files nil)
(setq auto-save-default nil)
(setq ring-bell-function 'ignore)
(global-prettify-symbols-mode t)
(defalias 'yes-or-no-p 'y-or-n-p)
(global-hl-line-mode t)
(add-hook 'prog-mode-hook #'display-line-numbers-mode)

;; Faces
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(default ((t (:family "DejaVu Sans Mono" :foundry "PfEd" :weight regular :height 233 :width normal :slant oblique))))
 '(line-number ((t (:inherit (ef-themes-fixed-pitch shadow default) :slant italic :height 200 :family "Monaspace Neon NF"))))
 '(line-number-current-line ((t (:inherit line-number))))
 '(line-number-major-tick ((t (:inherit line-number))))
 '(variable-pitch ((t (:family "Sans" :slant normal :weight regular :height 140 :width normal)))))

;; Theme
(load-theme 'ef-light t)

;; Packages
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)

;; Helpers
(use-package async)
(use-package counsel)
(use-package company :defer t)
(use-package diminish)
(use-package swiper :bind ("C-s" . 'swiper))
(use-package undo-tree :diminish undo-tree-mode)
(use-package yaml-mode :defer t)

;; Ivy
(use-package ivy
  :diminish ivy-mode
  :config
  (setopt ivy-use-virtual-buffers t)
  (setcdr (assq 'read-file-name-internal ivy-sort-functions-alist) 'ido-file-extension-lessp)
  (setopt enable-recursive-minibuffers t)
  (add-hook 'emacs-startup-hook (ivy-mode))
  (add-hook 'emacs-startup-hook (dired-async-mode 1)))

;; Org-mode
(setq org-link-descriptive nil)

;; Ruby
(use-package ruby-mode
  :defer t
  :config
  (add-hook 'ruby-mode-hook 'company-mode)
  (add-hook 'ruby-mode-hook 'eglot-ensure))

;;; Non-editing Packages
;; Dashboard
(use-package dashboard
  :ensure t
  :config
  (setq dashboard-center-content t)
  (setq dashboard-vertically-center-content t)
  (dashboard-setup-startup-hook))

;; Elfeed
(use-package elfeed :defer t)
(defun elfeed-search-format-date (date)
  (format-time-string "%Y-%m-%d %H:%M" (seconds-to-time date)))
(setq-default elfeed-search-filter "-politics -products ")
(setq browse-url-browser-function 'eww-browse-url)
(setq elfeed-feeds '(("https://www.dragonflydigest.com/feed/" freesoftware os bsd)
                     ("https://fedoramagazine.org/feed/" freesoftware os linux)
                     ("https://static.fsf.org/fsforg/rss/news.xml" freesoftware gnu)
                     ("https://lwn.net/headlines/Features" freesoftware security)
                     ("https://rubyweekly.com/rss/" freesoftware ruby programming)
                     ("https://jvns.ca/atom.xml" freesoftware programming)
                     ("https://www.raspberrypi.com/news/feed/" freesoftware products)
                     ("https://mastodon.social/@mntmn.rss" freesoftware products)
                     ("https://liliputing.com/feed" products)
                     ("https://www.openrightsgroup.org/rss.xml" news politics)
                     ("https://www.theguardian.com/uk-news/rss" news politics)
                     ("https://blog.archive.org/feed" news)
                     ("https://solar.lowtechmagazine.com/feeds" blog)
                     ("https://www.abortretry.fail/feed" blog os)
                     ("https://planet.emacslife.com/atom.xml" blog emacs)))

(defun elfeed-olivetti (buff)
  (switch-to-buffer buff)
  (olivetti-mode)
  (elfeed-show-refresh))
(setq elfeed-show-entry-switch 'elfeed-olivetti)

;; EMMS
(use-package emms
  :defer t
  :config
  (emms-all)
  (setq emms-player-list '(emms-player-mpv))
  (setq emms-repeat-playlist t)
  (setq emms-source-file-default-directory "~/Music/library")
  :custom
  (emms-browser-covers #'emms-browser-cache-thumbnail-async))

;; Elisp
(setq eval-expression-print-length nil)
(setq eshell-prompt-regexp "^[^αλ\n]*[αλ] ")
(setq eshell-prompt-function
      (lambda nil
        (concat
         (if (= (user-uid) 0)
             (propertize " α ")
           (propertize " λ ")))))

Author: Patrick

Created: 2026-01-16 Fri 14:25

Emacs 30.2 (Org mode 9.7.11)

Validate