81 lines
2.9 KiB
EmacsLisp
81 lines
2.9 KiB
EmacsLisp
;; Fixes a MELPA 403
|
|
(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")
|
|
|
|
;; Show errors at minimum
|
|
(setq warning-minimum-level :error)
|
|
|
|
;;; Utility functions
|
|
;; https://emacs.stackexchange.com/a/18441
|
|
(defun load-directory (directory)
|
|
"Load recursively all `.el' files in DIRECTORY."
|
|
(dolist (element (directory-files-and-attributes directory nil nil nil))
|
|
(let* ((path (car element))
|
|
(fullpath (concat directory "/" path))
|
|
(isdir (car (cdr element)))
|
|
(ignore-dir (or (string= path ".") (string= path ".."))))
|
|
(cond
|
|
((and (eq isdir t) (not ignore-dir))
|
|
(load-directory fullpath))
|
|
((and (eq isdir nil) (string= (substring path -3) ".el"))
|
|
(load (file-name-sans-extension fullpath)))))))
|
|
|
|
;;; Package Repositories
|
|
(require 'package)
|
|
(add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/"))
|
|
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
|
|
(add-to-list 'package-archives '("nongnu" . "https://elpa.nongnu.org/nongnu/") t)
|
|
(package-initialize)
|
|
|
|
;; Install straight.el
|
|
(defvar bootstrap-version)
|
|
(let ((bootstrap-file
|
|
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
|
|
(bootstrap-version 6))
|
|
(unless (file-exists-p bootstrap-file)
|
|
(with-current-buffer
|
|
(url-retrieve-synchronously
|
|
"https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
|
|
'silent 'inhibit-cookies)
|
|
(goto-char (point-max))
|
|
(eval-print-last-sexp)))
|
|
(load bootstrap-file nil 'nomessage))
|
|
|
|
;; Install use-package
|
|
(straight-use-package 'use-package)
|
|
|
|
;; Use straight by default
|
|
(setq straight-use-package-by-default t)
|
|
|
|
;; Always ensure packages to install them automatically
|
|
(require 'use-package-ensure)
|
|
(setq use-package-always-ensure t)
|
|
|
|
;; TODO: https://github.com/joaotavora/eglot/discussions/1487
|
|
(use-package eldoc :straight (:type built-in))
|
|
(use-package org :straight (:type built-in))
|
|
|
|
(setq inhibit-startup-screen t
|
|
inhibit-startup-message t
|
|
inhibit-startup-echo-area-message t
|
|
initial-scratch-message nil)
|
|
|
|
;; Shared library packages
|
|
(load (concat user-emacs-directory "shared-packages.el"))
|
|
;; UI and display related packages
|
|
(load (concat user-emacs-directory "ui.el"))
|
|
;; Writing behavior and packages
|
|
(load (concat user-emacs-directory "writing.el"))
|
|
;; Navigation behavior and packages
|
|
(load (concat user-emacs-directory "navigation.el"))
|
|
;; Window rules
|
|
(load (concat user-emacs-directory "window-utils.el"))
|
|
;; Userland application replacements
|
|
(load-directory (concat user-emacs-directory "userland"))
|
|
;; Mode/workflow level configuration
|
|
(load-directory (concat user-emacs-directory "workflows"))
|
|
;; Custom screens
|
|
(load-directory (concat user-emacs-directory "screens"))
|
|
|
|
;; Use a custom file instead of putting customisations in init.el
|
|
(setq custom-file (concat user-emacs-directory "custom.el"))
|
|
(when (file-exists-p custom-file) (load custom-file))
|