Remove melpa, only use melpa-stable

This commit is contained in:
Evie Litherland-Smith 2024-08-07 17:54:38 +01:00
parent 7b2e687b4b
commit 2ffd455abf

View file

@ -5,43 +5,20 @@
Personal Emacs configuration. Clone to =~/.config/emacs/= (or
=~/.emacs.d/=) and install specified plugins.
* Config
Customise =use-package= first, configuration must be set before first
time it's used.
#+begin_src emacs-lisp
;; Configure packages archives with priority
(setopt use-package-check-before-init t
use-package-enable-imenu-support t)
(use-package package
:custom
(package-archive-priorities '(("melpa" . 4) ("stable" . 3) ("nongnu" . 2) ("gnu" . 1)))
:config
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(add-to-list 'package-archives '("stable" . "https://stable.melpa.org/packages/"))
(package-initialize))
;; Plugins that still need adding / configuring: `auctex' `htmlize'
;; `password-store'
#+end_src
Load =custom.el= if file exists in default location.
#+begin_src emacs-lisp
(setq custom-file (locate-user-emacs-file "custom.el"))
(when (and custom-file (file-exists-p custom-file))
(load custom-file nil 'nomessage))
#+end_src
** Defaults
Set some useful defaults. Some of these should be moved to relevant
section of config.
section of configuration.
#+begin_src emacs-lisp
(setq user-full-name "Evie Litherland-Smith"
user-mail-address "evie@xenia.me.uk"
custom-file (locate-user-emacs-file "custom.el")
use-short-answers t
kill-do-not-save-duplicates t)
(when (and custom-file (file-exists-p custom-file))
(load custom-file nil 'nomessage))
(set-default-coding-systems 'utf-8)
(global-auto-revert-mode +1)
(delete-selection-mode +1)
@ -50,6 +27,35 @@ section of config.
(keymap-global-set "<mouse-8>" #'previous-buffer)
(keymap-global-set "<mouse-9>" #'next-buffer)
#+end_src
Customise =use-package= separately as configuration must be set before
first time it's used.
#+begin_src emacs-lisp
(setopt use-package-check-before-init t
use-package-enable-imenu-support t)
#+end_src
Filter warning messages from causing popups. Keep in log, but only
show for error or emergency.
#+begin_src emacs-lisp
(setq warning-minimum-level :error)
#+end_src
Configure package archives and initialise.
#+begin_src emacs-lisp
(use-package package
:custom
(package-install-upgrade-built-in t)
:config
(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/"))
(package-initialize))
;; Plugins that still need adding / configuring: `auctex' `htmlize'
;; `password-store'
#+end_src
** UI and Appearance
Configure the look and feel of Emacs
@ -97,34 +103,29 @@ Configure the look and feel of Emacs
:foreground
(plist-get base16-one-light-theme-colors (cdr pairing)))))
(when (display-graphic-p)
;; (add-hook server-after-make-frame-hook #'my/load-theme-and-configure)
(my/load-theme-and-configure))
(require 'server)
(add-hook 'after-init-hook
(lambda () (when (display-graphic-p) (my/load-theme-and-configure))))
(add-hook 'server-after-make-frame-hook
(lambda () (when (display-graphic-p) (my/load-theme-and-configure))))
(use-package nerd-icons
:ensure t
:functions (nerd-icons-octicon))
(use-package all-the-icons
:ensure t)
(use-package nerd-icons-dired
(use-package all-the-icons-dired
:ensure t
:requires nerd-icons
:after all-the-icons
:hook (dired-mode))
(use-package nerd-icons-ibuffer
(use-package all-the-icons-ibuffer
:ensure t
:requires nerd-icons
:after all-the-icons
:hook (ibuffer-mode))
(use-package nerd-icons-completion
(use-package all-the-icons-completion
:ensure t
:requires nerd-icons
:functions nerd-icons-completion-mode
:hook (after-init . (lambda () (nerd-icons-completion-mode +1))))
(use-package nerd-icons-corfu
:ensure t
:requires nerd-icons
:functions nerd-icons-corfu-formatter)
:after (all-the-icons marginalia-mode)
:hook (marginalia-mode . all-the-icons-completion-marginalia-setup))
#+end_src
*** Modeline
#+begin_src emacs-lisp
@ -168,6 +169,7 @@ Configure the look and feel of Emacs
#+begin_src emacs-lisp
(use-package ligature
:ensure t
:disabled t
:functions (ligature-set-ligatures
global-ligature-mode)
:config
@ -659,7 +661,7 @@ Configure email with iCalendar event support, to integrate with
(auth-sources '("secrets:Login")))
(use-package auth-source-pass
:requires auth-source
:after auth-source
:config
(auth-source-pass-enable))
@ -913,39 +915,40 @@ Configure email with iCalendar event support, to integrate with
(file+olp "calendar/email.org.gpg" "Inbox")
"%i" :immediate-finish t))))
(if (executable-find "sqlite3")
(use-package org-roam
:ensure t
:after org
:defines org-roam-directory
:functions org-roam-db-autosync-mode
:bind (("C-c o r i" . org-roam-node-insert)
("C-c o r f" . org-roam-node-find)
("C-c o r n" . org-roam-capture)
("C-c o r j" . org-roam-dailies-capture-today)
("M-g j" . org-roam-dailies-goto-today)
("M-g C-j" . org-roam-dailies-goto-date)
:map org-mode-map
("C-c o r b" . org-roam-buffer-toggle))
:custom
(org-roam-directory (expand-file-name "roam" org-directory))
(org-roam-completion-everywhere nil)
(org-roam-node-display-template (concat
"${title:*} "
(propertize "${tags:24}" 'face 'org-tag)))
(org-roam-capture-templates '(("d" "default" plain "%?"
:target (file+head "${slug}.org" "#+title: ${title}\n")
:unnarrowed t)))
:config
(mkdir org-roam-directory t)
(add-to-list 'display-buffer-alist
'("\\*org-roam\\*"
(display-buffer-in-side-window)
(side . right)
(slot . 0)
(window-width . 0.33)
(window-parameters . ((no-delete-other-windows . t)))))
(org-roam-db-autosync-mode +1)))
(when (or (package-installed-p 'emacsql-sqlite)
(package-installed-p 'emacsql-sqlite-builtin))
(use-package org-roam
:ensure t
:after org
:defines org-roam-directory
:functions org-roam-db-autosync-mode
:bind (("C-c o r i" . org-roam-node-insert)
("C-c o r f" . org-roam-node-find)
("C-c o r n" . org-roam-capture)
("C-c o r j" . org-roam-dailies-capture-today)
("M-g j" . org-roam-dailies-goto-today)
("M-g C-j" . org-roam-dailies-goto-date)
:map org-mode-map
("C-c o r b" . org-roam-buffer-toggle))
:custom
(org-roam-directory (expand-file-name "roam" org-directory))
(org-roam-completion-everywhere nil)
(org-roam-node-display-template (concat
"${title:*} "
(propertize "${tags:24}" 'face 'org-tag)))
(org-roam-capture-templates '(("d" "default" plain "%?"
:target (file+head "${slug}.org" "#+title: ${title}\n")
:unnarrowed t)))
:config
(mkdir org-roam-directory t)
(add-to-list 'display-buffer-alist
'("\\*org-roam\\*"
(display-buffer-in-side-window)
(side . right)
(slot . 0)
(window-width . 0.33)
(window-parameters . ((no-delete-other-windows . t)))))
(org-roam-db-autosync-mode +1)))
(use-package org-roam-dailies
:after org-roam
@ -1006,6 +1009,7 @@ Configure email with iCalendar event support, to integrate with
(use-package org-noter
:ensure t
:disabled t
:after (org doc-view citar)
:commands org-noter
:custom
@ -1043,7 +1047,7 @@ Configure email with iCalendar event support, to integrate with
(expand-file-name "~/Documents/library/")))
:config
(require 'org)
(require 'nerd-icons)
(require 'all-the-icons)
(setopt org-cite-insert-processor 'citar
org-cite-follow-processor 'citar
org-cite-activate-processor 'citar)
@ -1051,36 +1055,25 @@ Configure email with iCalendar event support, to integrate with
(add-to-list 'org-cite-global-bibliography bibfile))
(defvar citar-indicator-files-icons
(citar-indicator-create
:symbol (nerd-icons-octicon
"nf-oct-file"
:face 'nerd-icons-green
:v-adjust -0.1)
:symbol (all-the-icons-octicon "file-pdf")
:function #'citar-has-files
:padding " " ; need this because the default padding is too low for these icons
:tag "has:files"))
(defvar citar-indicator-links-icons
(citar-indicator-create
:symbol (nerd-icons-octicon
"nf-oct-link"
:face 'nerd-icons-orange
:v-adjust 0.01)
:symbol (all-the-icons-octicon "link")
:function #'citar-has-links
:padding " " ; need this because the default padding is too low for these icons
:tag "has:links"))
(defvar citar-indicator-notes-icons
(citar-indicator-create
:symbol (nerd-icons-octicon
"nf-oct-note"
:face 'nerd-icons-blue
:v-adjust -0.3)
:symbol (all-the-icons-octicon "file-text")
:function #'citar-has-notes
:padding " " ; need this because the default padding is too low for these icons
:tag "has:notes"))
(defvar citar-indicator-cited-icons
(citar-indicator-create
:symbol (nerd-icons-octicon
"nf-oct-circle"
:face 'nerd-icon-green)
:symbol (all-the-icons-octicon "file-binary")
:function #'citar-is-cited
:padding " " ; need this because the default padding is too low for these icons
:tag "is:cited"))
@ -1144,8 +1137,6 @@ Configure email with iCalendar event support, to integrate with
(corfu-preselect 'directory)
:config
(require 'corfu-history)
(when (require 'nerd-icons-corfu nil :noerror)
(add-to-list 'corfu-margin-formatters #'nerd-icons-corfu-formatter))
(when (require 'corfu-popupinfo nil :noerror)
(corfu-popupinfo-mode +1))
(when (and (require 'corfu-terminal nil :noerror)
@ -1153,13 +1144,13 @@ Configure email with iCalendar event support, to integrate with
(corfu-terminal-mode +1)))
(use-package corfu-history
:requires (corfu savehist)
:after (corfu savehist)
:functions corfu-history
:config
(add-to-list 'savehist-additional-variables #'corfu-history))
(use-package corfu-popupinfo
:requires corfu
:after corfu
:defines corfu-popupinfo-map
:functions corfu-popupinfo-mode
:bind ( :map corfu-popupinfo-map
@ -1171,7 +1162,7 @@ Configure email with iCalendar event support, to integrate with
(use-package corfu-terminal
:ensure t
:requires corfu
:after corfu
:functions corfu-terminal-mode)
(use-package cape
@ -1264,7 +1255,7 @@ Configure email with iCalendar event support, to integrate with
(use-package treesit-auto
:ensure t
:requires treesit
:after treesit
:functions (treesit-auto-add-to-auto-mode-alist
global-treesit-auto-mode)
:hook (after-init . (lambda () (global-treesit-auto-mode +1)))
@ -1356,29 +1347,31 @@ Configure email with iCalendar event support, to integrate with
(use-package flymake-shellcheck
:ensure t
:disabled t
:functions flymake-shellcheck-load
:requires flymake
:after flymake
:hook (sh-mode . (lambda () (if (executable-find "shellcheck" t)
(flymake-shellcheck-load)))))
(use-package flymake-yamllint
:ensure t
:functions flymake-yamllint-setup
:requires flymake
:after flymake
:hook (yaml-ts-mode . (lambda () (if (executable-find "yamllint" t)
(flymake-yamllint-setup)))))
(use-package flymake-clippy
:ensure t
:disabled t
:functions flymake-clippy-setup-backend
:requires flymake
:after flymake
:hook (rust-mode . (lambda () (if (executable-find "clippy" t)
(flymake-clippy-setup-backend)))))
(use-package flymake-eslint
:ensure t
:functions flymake-eslint-enable
:requires flymake
:after flymake
:hook ((js-base-mode typescript-ts-base-mode) . (lambda () (if (executable-find "eslint" t)
(flymake-eslint-enable)))))
@ -1436,15 +1429,15 @@ Configure email with iCalendar event support, to integrate with
(when (executable-find "nix")
(use-package nix-mode
:ensure t
:mode "\\.nix\\'"
:functions nix-prettify-global-mode
:config
(require 'nix)
(require 'nix-flake)
(require 'nix-repl)
(require 'nix-store)
(nix-prettify-global-mode +1)))
:ensure t
:mode "\\.nix\\'"
:functions nix-prettify-global-mode
:config
(require 'nix)
(require 'nix-flake)
(require 'nix-repl)
(require 'nix-store)
(nix-prettify-global-mode +1)))
(use-package lua-mode
:ensure t
@ -1478,6 +1471,7 @@ Configure email with iCalendar event support, to integrate with
(use-package python-docstring
:ensure t
:disabled t
:hook python-base-mode)
(use-package files