Bootstrap
(defun uno-emacs-path (name)
"Path of NAME relative to user Emacs directory."
(expand-file-name (locate-user-emacs-file
(convert-standard-filename name))))
(defun uno-path (&optional name)
"Path of NAME relative to uno directory."
(uno-emacs-path (concat "uno/" name)))
(defun uno-assets-path (&optional name)
"Path of NAME relative to uno assets directory."
(uno-path (concat "assets/" name)))
(defun uno-cache-path (&optional name)
"Path of NAME relative to uno cache directory."
(uno-emacs-path (concat "cache/" name)))
(defun uno-private-path (&optional name)
"Path of NAME relative to uno private directory."
(uno-path (concat "private/" name)))
(defvar uno-local (uno-private-path "local.el")
"Localized customization file.")
(defvar uno-local-after-hook nil
"Hook to run after customizations are done.")
(load uno-local 'noerror)
Isolate or remove backup files for a clean structure.
(setq
auto-save-file-name-transforms `((".*" ,temporary-file-directory t))
auto-save-list-file-prefix (uno-cache-path "auto-save-list/.saves-")
backup-directory-alist `((".*" . ,temporary-file-directory))
bookmark-default-file (uno-cache-path "bookmarks")
create-lockfiles nil
recentf-save-file (uno-cache-path "recentf/list")
tramp-persistency-file-name (uno-cache-path "tramp/history"))
Run bootstrap code for straight and have use-package ready.
(setq
straight-profiles `((nil . ,(uno-emacs-path "straight.lock.el")))
straight-use-package-by-default t)
(let ((bootstrap-file
(uno-emacs-path "straight/repos/straight.el/bootstrap.el"))
(bootstrap-version 5))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
(straight-use-package 'use-package)
(use-package general)
Set up general and leader key binds that are used throughout.
(use-package evil
:custom
(evil-want-keybinding nil)
:init
(general-evil-setup))
(use-package general
:custom
(general-override-states '(insert
emacs
hybrid
normal
visual
motion
operator
replace))
:init
(defvar uno-leader-key "SPC"
"Leader key.")
(defvar uno-mode-leader-key ","
"Mode leader key.")
:config
(general-create-definer uno-define
:states '(motion normal visual))
(general-create-definer uno-leader-define
:prefix uno-leader-key
:keymaps 'override
:states '(motion normal visual))
(general-create-definer uno-mode-leader-define
:prefix uno-mode-leader-key
:keymaps 'override
:states '(motion normal visual)))
(let* ((uno-module-directory (uno-path "modules/"))
(uno-module-files (directory-files-recursively
uno-module-directory
"\\.org$"
nil
t)))
(dolist (file (reverse uno-module-files))
(org-babel-load-file file)))
(when (null custom-file)
(setq custom-file (uno-cache-path "custom.el"))
(load custom-file 'noerror))
(run-hooks 'uno-local-after-hook)