#+TITLE: Bootstrap #+AUTHOR: Juan Placencia * Helpers #+BEGIN_SRC emacs-lisp (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))) #+END_SRC * Local Customizations (Pre-Bootstrap) #+BEGIN_SRC emacs-lisp (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) #+END_SRC * Backup Files Isolate or remove backup files for a clean structure. #+BEGIN_SRC emacs-lisp (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 nsm-settings-file (uno-cache-path "network-security.data") recentf-save-file (uno-cache-path "recentf/list") tramp-persistency-file-name (uno-cache-path "tramp/history")) #+END_SRC * General Set up generic and leader key binds that are used throughout. =general= is loaded first to set up integration with =evil= before setting up =general=. #+BEGIN_SRC emacs-lisp (use-package general) (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))) #+END_SRC * Modules Traverse through modules and load each one. #+BEGIN_SRC emacs-lisp (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))) #+END_SRC * Isolate Custom File #+BEGIN_SRC emacs-lisp (when (null custom-file) (setq custom-file (uno-cache-path "custom.el")) (load custom-file 'noerror)) #+END_SRC * Local Customizations (Post-Bootstrap) #+BEGIN_SRC emacs-lisp (run-hooks 'uno-local-after-hook) #+END_SRC