;;; init --- Summary ;;; Commentary: ;;; Code: (setq custom-file (concat user-emacs-directory "customizations.el")) (load custom-file) ;; Initialize the package system and use-package (setq load-prefer-newer t) ;; Add my own, version controlled ~lisp~ directory to ~load-path~ (add-to-list 'load-path (expand-file-name (convert-standard-filename "lisp/") user-emacs-directory)) ;; Do the same with the local ~site-lisp~ if it’s there (let ((site-lisp-dir "/usr/local/share/emacs/site-lisp")) (when (file-directory-p site-lisp-dir) (dolist (elt (directory-files site-lisp-dir)) (unless (or (string= elt ".") (string= elt "..")) (add-to-list 'load-path (expand-file-name elt site-lisp-dir)))))) ;; I prefer using freedesktop’s desktop specification everywhere (load "xdg-paths") ;; Set up the package manager ;; Package archives (require 'package) ;; GNU ELPA (add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/")) ;; MELPA Stable (add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t) ;; MELPA (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) ;; Finally, initialise the package manager (package-initialize) ;; use-package is a really convenient way to install packages. It’s installed in 30.1, but let’s stay on the safe side. (unless (package-installed-p 'use-package) (package-refresh-contents) (package-install 'use-package)) (require 'use-package) (use-package use-package :custom (use-package-always-ensure t) (use-package-verbose nil)) (use-package bind-key) ;; Custom functions and commands (load "gpolonkai/utilities") (load "gpolonkai/windows") (load "gpolonkai/org-utils") (load "gpolonkai/text-utils") (load "gpolonkai/nav-utils") (load "gpolonkai/file-utils") (load "gpolonkai/magit-utils") (defun crm-indicator (args) "Generate a prompt for `completing-read-multiple'. ARGS is a cons cell of two strings, which will be used in the prompt in reverse order." (cons (format "[CRM%s] %s" (replace-regexp-in-string "\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" "" crm-separator) (car args)) (cdr args))) (use-package emacs :ensure nil :init ;; Required for Consult/Vertico (advice-add #'completing-read-multiple :filter-args #'crm-indicator) (setq frame-title-format '((:eval (concat system-name ": " (if (buffer-file-name) (abbreviate-file-name (buffer-file-name)) "%b"))))) :custom (user-full-name "Gergely Polonkai") (user-mail-address "gergely@polonkai.eu") (kill-read-only-ok t) (use-dialog-box nil) (cursor-type 'bar) (echo-keystrokes .01) (fill-column 120) (initial-scratch-message "") (minibuffer-prompt-properties '(read-only t cursor-intangible t face minibuffer-prompt)) (enable-recursive-minibuffers t) (completion-cycle-threshold 3) (tab-always-indent 'complete) :hook (minibuffer-setup . cursor-intangible-mode)) ;; I started moving my configuration to this Org file. It’s easier to document this way. (org-babel-load-file (expand-file-name "configuration.org" user-emacs-directory)) ;;; init.el ends here