From 3b53c19e2aef54d1f331b357734ac569cd6da468 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Thu, 29 May 2025 18:48:22 +0200 Subject: [PATCH] Move the use-package settings to init.el --- configuration.org | 36 ------------------------------------ init.el | 29 +++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 36 deletions(-) diff --git a/configuration.org b/configuration.org index cce7923..d395eee 100644 --- a/configuration.org +++ b/configuration.org @@ -1,39 +1,3 @@ -* Set up the package manager - -I’m a ~package.el~ user. Don’t package-shame me! - -** Set up the package archives - -#+begin_src emacs-lisp -(require 'package) -(add-to-list 'package-archives - '("gnu" . "https://elpa.gnu.org/packages/")) -(add-to-list 'package-archives - '("melpa-stable" . "https://stable.melpa.org/packages/") t) -(add-to-list 'package-archives - '("melpa" . "https://melpa.org/packages/") t) -(package-initialize) -#+end_src - -** Set up ~use-package~ - -It is built-in since 29.1, and let’s hope I never get back using older versions, but let’s stay on the safe side for now. - -#+begin_src emacs-lisp -(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) -#+end_src - * Custom functions and commands This is a collection of functions and commands i wrote or stole from all around the internet. diff --git a/init.el b/init.el index d7224dd..0bbec16 100644 --- a/init.el +++ b/init.el @@ -27,6 +27,35 @@ ;; 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) + ;; 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))