Files
sydnix/modules/home/users/msyds/emacs/init.el

50 lines
1.2 KiB
EmacsLisp

;;; init.el -*- lexical-binding: t -*-
(require 'cl-lib)
(defconst syd-features
'(syd/base
syd/constants
syd/dash
syd/disable-package
syd/straight
syd/general
syd/kanagawa-palette
syd/on
syd/prelude
syd/use-package
syd/line-numbers
syd/kanagawa
syd/comint
syd/evil
syd/scrolling
syd/fonts
syd/frame
syd/risky-variables
syd/completion
syd/emacs-lisp
syd/vc
syd/compilation
syd/grep
syd/top-level-keymaps
syd/escape
syd/leader
syd/which-key))
(defun syd-random-permutation (lst &optional seed)
"Return a random permutation of list LST using SEED as the random state. The
permutation is deterministic for a given SEED."
(let* ((random-state (cl-make-random-state (or seed (random))))
(len (length lst))
(vec (vconcat lst)))
;; Fisher-Yates shuffle.
(cl-loop for i from (1- len) downto 1 do
(cl-rotatef (aref vec i)
(aref vec (cl-random (1+ i) random-state))))
;; Convert vector to list.
(append vec nil)))
(dolist (feature (syd-random-permutation syd-features
syd-init-load-order-seed))
(require feature))