First commit

main
Michael Fiano 12 months ago
commit 403300feb4
  1. 81
      early-init.el
  2. 18
      init.el
  3. 162
      lisp/mf-core-settings.el
  4. 140
      lisp/mf-key-bindings.el
  5. 122
      lisp/mf-pkg-builtin.el
  6. 80
      lisp/mf-pkg-completion.el
  7. 71
      lisp/mf-pkg-editing.el
  8. 135
      lisp/mf-pkg-lang-common-lisp.el
  9. 34
      lisp/mf-pkg-lang-elisp.el
  10. 54
      lisp/mf-pkg-lang-lisp.el
  11. 90
      lisp/mf-pkg-lang-org.el
  12. 49
      lisp/mf-pkg-project.el
  13. 21
      lisp/mf-pkg-startup.el
  14. 157
      lisp/mf-pkg-ui.el
  15. 39
      lisp/mf-pkg-util.el
  16. 14
      lisp/mf-pkg-window.el
  17. 133
      lisp/mf-setup.el
  18. 115
      lisp/mf-util.el
  19. 106
      lockfile

@ -0,0 +1,81 @@
;;;; -*- lexical-binding: t; -*-
;;; ============================================================================
;;; Emacs startup optimizations
;;; ============================================================================
;; Garbage collection slows down startup time, so we maximize the threshold for
;; it to run, and we will later reset it.
(setq gc-cons-threshold most-positive-fixnum)
;; file-name-handler-alist is consulted on various I/O functions such as
;; REQUIRE, slowing down startup time, so we set it to NIL, and establish a hook
;; to restore when Emacs is finished starting.
(unless (or (daemonp) noninteractive)
(let ((file-name-handler-alist/old file-name-handler-alist))
(setq file-name-handler-alist nil)
(add-hook 'emacs-startup-hook
(lambda ()
(let ((value (delete-dups
(append file-name-handler-alist
file-name-handler-alist/old))))
(setq file-name-handler-alist value))))))
(unless (daemonp)
(advice-add #'tty-run-terminal-initialization :override #'ignore)
(add-hook 'window-setup-hook
(lambda ()
(advice-remove #'tty-run-terminal-initialization #'ignore)
(tty-run-terminal-initialization (selected-frame) nil t))))
;;; ============================================================================
;;; Specify some directory paths
;;; ============================================================================
;; For the rest of the Emacs configuration, set this directory to something
;; inside the standard cache directory, so we do not pollute our emacs.d
;; directory with files that we would then have to ignore with Git.
(setq user-emacs-directory
(expand-file-name "emacs/" (or (getenv "XDG_CACHE_HOME") "~/.cache/")))
;; Add our custom lisp modules to the Emacs load path so they can be discovered.
(push (expand-file-name "lisp/" (file-name-directory user-init-file)) load-path)
;; For the list of native compilation ELN cache directories, delete all but the
;; last element, which is always assumed to be the system path, and then cons a
;; new path in our cache directory to the front. This effectively removes the
;; entry for the original ~/.emacs.d/eln-cache/ and any others that are
;; unwanted.
(setq native-comp-eln-load-path
(cons (expand-file-name "eln-cache/" user-emacs-directory)
(last native-comp-eln-load-path)))
;;; ============================================================================
;;; Set up the package manager
;;; ============================================================================
;; Pre-configure the package manager settings before it is loaded.
(setq package-enable-at-startup nil)
(setq package-quickstart nil)
(setq straight-check-for-modifications '(check-on-save find-when-checking))
;; Bootstrap the straight.el package manager if it is not already installed,
;; then unconditionally load it. We use this rather than Emacs' built-in package
;; manager.
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el"
user-emacs-directory))
(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))
;; Additional post-setup of straight.el.
(require 'straight-x)
(defalias 'straight-ಠ_ಠ-mode nil)

@ -0,0 +1,18 @@
;;;; -*- lexical-binding: t; -*-
(require 'mf-util)
(require 'mf-setup)
(require 'mf-core-settings)
(require 'mf-pkg-startup)
(require 'mf-pkg-builtin)
(require 'mf-pkg-util)
(require 'mf-pkg-ui)
(require 'mf-pkg-editing)
(require 'mf-pkg-completion)
(require 'mf-pkg-window)
(require 'mf-pkg-project)
(require 'mf-pkg-lang-org)
(require 'mf-pkg-lang-lisp)
(require 'mf-pkg-lang-elisp)
(require 'mf-pkg-lang-common-lisp)
(require 'mf-key-bindings)

@ -0,0 +1,162 @@
;;;; -*- lexical-binding: t; -*-
(setup appearance
(setq blink-matching-paren nil)
(setq display-time-default-load-average nil)
(setq echo-keystrokes 0.1)
(setq highlight-nonselected-windows nil)
(setq idle-update-delay 1.0)
(setq inhibit-startup-echo-area-message t)
(setq inhibit-startup-screen t)
(setq use-dialog-box nil)
(setq use-file-dialog nil)
(setq visible-bell nil)
(setq x-gtk-use-system-tooltips nil)
(setq x-stretch-cursor nil)
(setq-default bidi-display-reordering 'left-to-right)
(setq-default bidi-paragraph-direction 'left-to-right)
(setq-default cursor-in-non-selected-windows nil)
(setq-default cursor-type 'hbar)
(setq-default display-line-numbers-widen t)
(setq-default display-line-numbers-width 3)
(setq-default indicate-buffer-boundaries nil)
(setq-default truncate-lines t)
(set-face-attribute 'default nil :font "Iosevka Slab" :height 105)
(blink-cursor-mode 0)
(column-number-mode 1)
(display-time-mode 0)
(fringe-mode '(4 . 0))
(menu-bar-mode 0)
(scroll-bar-mode 0)
(tool-bar-mode 0)
(tooltip-mode 0)
(window-divider-mode 1)
(:with-hook (prog-mode-hook text-mode-hook conf-mode-hook)
(:hook display-line-numbers-mode))
(:with-hook text-mode-hook
(:hook visual-line-mode)))
(setup encoding
(setq coding-system-for-read 'utf-8-unix)
(setq coding-system-for-write 'utf-8-unix)
(setq default-process-coding-system '(utf-8-unix utf-8-unix))
(setq locale-coding-system 'utf-8-unix)
(setq selection-coding-system 'utf-8)
(setq x-select-request-type nil)
(setq-default buffer-file-coding-system 'utf-8-unix)
(prefer-coding-system 'utf-8-unix)
(set-clipboard-coding-system 'utf-8)
(set-default-coding-systems 'utf-8-unix)
(set-keyboard-coding-system 'utf-8-unix)
(set-language-environment "UTF-8")
(set-selection-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8-unix))
(setup files
(setq auto-mode-case-fold nil)
(setq auto-save-default nil)
(setq auto-save-list-file-prefix nil)
(setq backup-inhibited t)
(setq create-lockfiles nil)
(setq delete-by-moving-to-trash nil)
(setq find-file-suppress-same-file-warnings t)
(setq find-file-visit-truename t)
(setq load-prefer-newer t)
(setq make-backup-files nil)
(setq require-final-newline t)
(setq vc-follow-symlinks t))
(setup frame
(setq frame-inhibit-implied-resize t)
(setq frame-resize-pixelwise t)
(setq truncate-partial-width-windows nil))
(setup minibuffer
(file-name-shadow-mode 1)
(minibuffer-depth-indicate-mode 1)
(minibuffer-electric-default-mode 1)
(fset #'yes-or-no-p #'y-or-n-p)
(setq enable-recursive-minibuffers t)
(setq file-name-shadow-properties '(invisible t intangible t))
(setq minibuffer-eldef-shorten-default t)
(setq minibuffer-prompt-properties
'(read-only t cursor-intangible t face minibuffer-prompt))
(setq read-answer-short t)
(setq read-extended-command-predicate #'command-completion-default-include-p)
(setq use-short-answers t)
(:with-hook minibuffer-setup-hook
(:hook cursor-intangible-mode)))
(setup misc
(setq ad-redefinition-action 'accept)
(setq bidi-inhibit-bpa t)
(setq command-line-ns-option-alist nil)
(setq custom-file (mf/etc-file "custom.el"))
(setq default-input-method "TeX")
(setq ffap-machine-p-known 'reject)
(setq inhibit-compacting-font-caches t)
(setq inhibit-default-init t)
(setq jit-lock-defer-time nil)
(setq jka-compr-verbose nil)
(setq native-comp-async-report-warnings-errors nil)
(setq read-file-name-completion-ignore-case t)
(setq read-process-output-max (* 64 1024))
(setq redisplay-skip-fontification-on-input t)
(setq ring-bell-function 'ignore)
(setq user-full-name "Michael Fiano")
(setq user-mail-address "mail@mfiano.net")
(setq-default fill-column 80)
(setq-default lexical-binding t))
(setup mouse
(setq focus-follows-mouse t)
(setq make-pointer-invisible t)
(setq mouse-1-click-follows-link t)
(setq mouse-autoselect-window t)
(setq mouse-wheel-follow-mouse t)
(setq mouse-wheel-progressive-speed nil)
(setq mouse-wheel-scroll-amount '(3 ((shift) . hscroll)))
(setq mouse-wheel-scroll-amount-horizontal 2)
(setq mouse-yank-at-point t))
(setup scratch
(setq initial-major-mode 'fundamental-mode)
(setq initial-scratch-message nil))
(setup scrolling
(setq auto-hscroll-mode 'current-line)
(setq auto-window-vscroll nil)
(setq fast-but-imprecise-scrolling t)
(setq hscroll-margin 16)
(setq hscroll-step 1)
(setq scroll-conservatively 101)
(setq scroll-margin 8)
(setq scroll-preserve-screen-position t)
(setq scroll-step 1))
(setup selection
(setq kill-do-not-save-duplicates t)
(setq select-enable-clipboard t)
(setq select-enable-primary t)
(setq x-select-enable-clipboard-manager nil))
(setup windows
(setq split-height-threshold nil)
(setq split-width-threshold 160)
(setq window-divider-default-bottom-width 2)
(setq window-divider-default-places t)
(setq window-divider-default-right-width 2)
(setq window-resize-pixelwise nil))
(setup whitespace
(setq backward-delete-char-untabify-method 'hungry)
(setq next-line-add-newlines nil)
(setq sentence-end-double-space nil)
(setq-default indent-tabs-mode nil)
(setq-default indicate-empty-lines nil)
(setq-default tab-always-indent nil)
(setq-default tab-width 4)
(:with-hook before-save-hook
(:hook delete-trailing-whitespace)))
(provide 'mf-core-settings)

@ -0,0 +1,140 @@
;;;; -*- lexical-binding: t; -*-
;;; ============================================================================
;;; Global bindings
;;; ============================================================================
(general-unbind
[insert]
[insertchar]
[M-mouse-1] [M-mouse-2] [M-mouse-3] [M-mouse-4] [M-mouse-5]
[C-mouse-1] [C-mouse-2] [C-mouse-3] [C-mouse-4] [C-mouse-5]
[S-mouse-1] [S-mouse-2] [S-mouse-3] [S-mouse-4] [S-mouse-5]
"C-x C-z")
(define-keys
[S-insert] #'mf/yank-primary-selection
[remap move-beginning-of-line] #'mf/smarter-move-beginning-of-line
[remap evil-beginning-of-line] #'mf/smarter-move-beginning-of-line
[remap newline] #'newline-and-indent)
(define-keys 'special-mode-map
"q" #'quit-window)
;;; ============================================================================
;;; Leader key bindings
;;; ============================================================================
(define-leader-keys
"SPC" '(execute-extended-command :wk t)
"TAB" '(persp-switch :wk t)
"'" '(vertico-repeat :wk t)
";" '(eval-expression :wk t)
"u" '(universal-argument :wk t))
(define-leader-keys
:infix "a"
"" '(:ignore t :wk "app")
"t" `(,(fn! (term (getenv "SHELL"))) :wk "terminal"))
(define-leader-keys
:infix "b"
"" '(:ignore t :wk "buffer")
"a" '(persp-add-buffer :wk "add")
"b" '(persp-switch-to-buffer* :wk "switch")
"d" `(,(fn! (kill-buffer nil)) :wk "delete")
"D" '(persp-kill-buffer* :wk "delete")
"r" '(revert-buffer :wk "revert")
"R" '(persp-remove-buffer :wk "remove"))
(define-leader-keys
:infix "f"
"" '(:ignore t :wk "file")
"c" `(,(fn! (call-interactively 'write-file)) :wk "copy")
"d" '(dired-jump :wk "directory")
"D" '(mf/delete-file :wk "delete")
"f" '(find-file :wk "find")
"r" '(consult-recent-file :wk "recent")
"R" '(mf/rename-file :wk "rename")
"s" '(save-buffer :wk "save")
"S" '(evil-write-all :wk "save all"))
(define-leader-keys
:infix "g"
"" '(:ignore t :wk "git")
"b" '(magit-blame-addition :wk "blame")
"g" '(gist-region-or-buffer :wk "gist")
"G" '(gist-region-or-buffer-private :wk "gist private")
"n" '(magit-init :wk "initialize repository")
"s" '(magit-status :wk "status")
"t" '(git-timemachine-toggle :wk "time machine")
"w" '(browse-at-remote :wk "browse remote"))
(define-leader-keys
:infix "h"
"" '(:ignore t :wk "help")
"." '(helpful-at-point :wk "point")
"a" '(consult-apropos :wk "apropos")
"c" '(describe-char :wk "character")
"f" '(helpful-callable :wk "function")
"F" '(describe-face :wk "face")
"i" '(info-lookup-symbol :wk "info")
"k" '(helpful-key :wk "key")
"l" '(find-library :wk "library")
"m" '(describe-minor-mode :wk "minor mode")
"M" '(describe-mode :wk "major mode")
"v" '(helpful-variable :wk "variable"))
(define-leader-keys
:infix "n"
"" '(:ignore t :wk "notes")
"a" '(archive :wk "archive")
"A" '(org-agenda :wk "agenda")
"c" '(org-capture :wk "capture")
"f" '(org-refile :wk "refile")
"t" '(org-babel-tangle :wk "tangle"))
(define-leader-keys
:infix "p"
"" '(:ignore t :wk "project")
"a" '(projectile-add-known-project :wk "add project")
"c" '(projectile-invalidate-cache :wk "clear cache")
"d" '(projectile-remove-known-project :wk "delete project")
"f" '(projectile-find-file :wk "find file")
"k" '(projectile-kill-buffers :wk "kill buffers")
"p" '(projectile-persp-switch-project :wk "switch project")
"r" '(projectile-recentf :wk "recent files")
"s" '(projectile-save-project-buffers :wk "save project files"))
(define-leader-keys
:infix "q"
"" '(:ignore t :wk "quit")
"q" '(evil-quit-all :wk "quit")
"Q" '(evil-save-and-quit :wk "save/quit"))
(define-leader-keys
:infix "s"
"" '(:ignore t :wk "search")
"b" '(consult-line :wk "search buffer")
"B" `(,(fn! (consult-line (thing-at-point 'symbol)))
:wk "search buffer for symbol at point")
"d" `(,(fn! (consult-ripgrep default-directory)) :wk "search directory")
"m" '(evil-multiedit-match-all :wk "multi-edit")
"p" '(consult-ripgrep :wk "search project"))
(define-leader-keys
:infix "w"
"" '(:ignore t :wk "window")
"-" '(evil-window-split :wk "split horizontal")
"|" '(evil-window-vsplit :wk "split vertical")
"=" '(balance-windows :wk "balance")
"d" '(evil-window-delete :wk "delete")
"D" '(delete-other-windows :wk "delete other")
"f" '(make-frame :wk "new frame")
"F" '(delete-frame :wk "delete-frame")
"r" '(winner-redo :wk "redo")
"s" '(ace-swap-window :wk "swap")
"u" '(winner-undo :wk "undo")
"w" '(ace-window :wk "go to"))
(provide 'mf-key-bindings)

@ -0,0 +1,122 @@
;;;; -*- lexical-binding: t; -*-
(setup auto-fill
(:with-feature simple
(:with-mode (text-mode org-mode)
(:hook turn-on-auto-fill))
(:with-mode prog-mode
(:hook (fn (setq-local comment-auto-fill-only-comments t)
(auto-fill-mode 1))))
(:hide-mode auto-fill-function)))
(setup (:require autorevert)
(setq auto-revert-check-vc-info t)
(setq auto-revert-remote-files t)
(setq global-auto-revert-non-file-buffers t)
(setq auto-revert-verbose nil)
(global-auto-revert-mode 1)
(:hide-mode auto-revert))
(setup comint
(setq ansi-color-for-comint-mode t)
(setq comint-buffer-maximum-size 4096)
(setq comint-prompt-read-only t))
(setup compile
(setq compilation-always-kill t)
(setq compilation-ask-about-save nil)
(setq compilation-scroll-output 'first-error))
(setup (:require delsel)
(delete-selection-mode 1))
(setup dired
(:also-load dired-x)
(:pkg dired-collapse
dired-git-info
dired-single
dired-subtree
diredfl)
(:with-map dired-mode-map
(:bind [tab] dired-subtree-cycle
"i" dired-subtree-toggle
"q" quit-window))
(:hook dired-collapse-mode)
(setq dired-recursive-copies 'top)
(setq dired-recursive-deletes 'top)
(diredfl-global-mode 1))
(setup (:require eldoc)
(setq eldoc-echo-area-use-multiline-p nil)
(setq eldoc-idle-delay 0.1)
(:with-mode prog-mode
(:hook turn-on-eldoc-mode))
(:hide-mode))
(setup (:require elec-pair)
(electric-pair-mode 1))
(setup executable
(setq executable-prefix-env t)
(:with-hook after-save-hook
(:hook executable-make-buffer-file-executable-if-script-p)))
(setup (:require goto-addr)
(:with-mode prog-mode
(:hook goto-address-prog-mode))
(:with-mode text-mode
(:hook goto-address-mode)))
(setup (:require help-mode)
(setq help-window-select t))
(setup (:require recentf)
(setq recentf-auto-cleanup 'mode)
(setq recentf-exclude `(,#'mf/cache-dir-p
"^/tmp/"
"COMMIT_EDITMSG$"
".gz$"))
(setq recentf-filename-handlers '(abbreviate-file-name))
(setq recentf-max-menu-items 100)
(setq recentf-max-saved-items nil)
(recentf-mode 1)
(run-at-time nil 120 (fn (quiet! (recentf-save-list))))
(:with-hook kill-emacs-hook
(:hook recentf-cleanup recentf-save-list)))
(setup (:require savehist)
(setq history-delete-duplicates t)
(setq history-length t)
(setq savehist-additional-variables
'(extended-command-history
global-mark-ring
kill-ring
mark-ring
regexp-search-ring
search-ring))
(setq savehist-autosave-interval 60)
(setq savehist-file (mf/etc-file "history"))
(setq savehist-save-minibuffer-history t)
(savehist-mode 1))
(setup (:require saveplace)
(setq save-place-file (mf/etc-file "places"))
(setq save-place-forget-unreadable-files nil)
(save-place-mode 1))
(setup (:require server)
(unless (server-running-p)
(server-start)))
(setup (:require subword)
(global-subword-mode 1)
(:hide-mode))
(setup (:require uniquify)
(setq uniquify-after-kill-buffer-p t)
(setq uniquify-buffer-name-style 'forward))
(setup (:require url)
(setq url-cookie-file (mf/etc-file "url-cookies")))
(provide 'mf-pkg-builtin)

@ -0,0 +1,80 @@
;;;; -*- lexical-binding: t; -*-
(setup (:pkg company)
(setq company-idle-delay nil)
(setq company-minimum-prefix-length 2)
(setq company-selection-wrap-around t)
(setq company-tooltip-align-annotations t)
(setq completion-at-point-functions '(company-complete-common))
(global-company-mode 1)
(company-tng-mode 1)
(:with-state insert
(:bind [tab] company-complete-common-or-cycle))
(:with-map company-active-map
(:bind [tab] company-select-next
[backtab] company-select-previous))
(:hide-mode))
(setup (:pkg consult)
(setq consult-preview-key (kbd "M-."))
(setq xref-show-definitions-function #'consult-xref)
(setq xref-show-xrefs-function #'consult-xref)
(advice-add #'completing-read-multiple
:override #'consult-completing-read-multiple)
(:load-after vertico
(setq completion-in-region-function
(lambda (&rest args)
(apply (if vertico-mode
#'consult-completion-in-region
#'completion--in-region)
args)))))
(setup (:pkg embark)
(:load-after which-key
(defun embark-which-key-indicator ()
(lambda (&optional keymap targets prefix)
(if (null keymap)
(which-key--hide-popup-ignore-command)
(which-key--show-keymap
(if (eq (plist-get (car targets) :type) 'embark-become)
"Become"
(format "Act on %s '%s'%s"
(plist-get (car targets) :type)
(embark--truncate-target (plist-get (car targets) :target))
(if (cdr targets) "" "")))
(if prefix
(pcase (lookup-key keymap prefix 'accept-default)
((and (pred keymapp) km) km)
(_ (key-binding prefix 'accept-default)))
keymap)
nil nil t (lambda (binding)
(not (string-suffix-p "-argument" (cdr binding))))))))
(setq prefix-help-command #'embark-prefix-help-command)
(setq embark-indicators '(embark-which-key-indicator
embark-highlight-indicator
embark-isearch-highlight-indicator))
(:advise embark-completing-read-prompter :around (fn &rest args)
(when-let ((win (get-buffer-window which-key--buffer 'visible)))
(quit-window 'kill-buffer win)
(let ((embark-indicators (delq #'embark-which-key-indicator
embark-indicators)))
(apply fn args))))
(:global "C-," embark-act)))
(setup (:pkg embark-consult)
(:load-after (embark consult)
(:with-mode embark-collect-mode
(:hook consult-preview-at-point-mode))))
(setup (:pkg orderless)
(setq completion-category-defaults nil)
(setq completion-category-overrides '((file (styles partial-completion))))
(setq completion-styles '(orderless)))
(setup (:pkg (vertico :files (:defaults "extensions/*")))
(:also-load vertico-repeat)
(setq vertico-count 15)
(setq vertico-resize t)
(vertico-mode 1))
(provide 'mf-pkg-completion)

@ -0,0 +1,71 @@
;;;; -*- lexical-binding: t; -*-
(setup (:pkg aggressive-indent)
(:hook-into prog-mode sly-mrepl-mode)
(:hide-mode))
(setup (:pkg avy)
(setq avy-all-windows nil)
(setq avy-background t)
(setq avy-keys (nconc (number-sequence ?a ?z)
(number-sequence ?A ?Z)
(number-sequence ?1 ?9)))
(setq avy-style 'pre))
(setup (:pkg evil)
(setq evil-move-beyond-eol t)
(setq evil-respect-visual-line-mode t)
(setq evil-undo-system 'undo-fu)
(setq evil-want-integration t)
(setq evil-want-keybinding nil)
(setq-default evil-shift-width tab-width)
(evil-mode 1))
(setup (:pkg evil-collection)
(:load-after evil
(evil-collection-init)
(:hide-mode evil-collection-unimpaired-mode)))
(setup (:pkg evil-commentary)
(:load-after evil
(:with-mode prog-mode
(:with-state (normal visual)
(:bind "gc" evil-commentary)))))
(setup (:pkg evil-multiedit)
(:load-after evil))
(setup (:pkg evil-surround)
(:load-after evil
(global-evil-surround-mode 1)))
(setup (:pkg expand-region)
(:require expand-region)
(:with-map prog-mode-map
(:with-state visual
(:bind "v" er/expand-region
"V" er/contract-region))))
(setup (:pkg hungry-delete)
(:load-after smartparens
(setq hungry-delete-join-reluctantly t)
(global-hungry-delete-mode 1)
(:hook-into smartparens-enabled)
(:hide-mode)))
(setup (:pkg undo-fu undo-fu-session)
(:with-map (prog-mode-map text-mode-map)
(:with-state normal
(:bind "u" undo-fu-only-undo
"C-r" undo-fu-only-redo)))
(setq undo-fu-session-incompatible-files
'("/COMMIT_EDITMSG\\'" "/git-rebase-todo\\'"))
(global-undo-fu-session-mode 1))
(setup (:pkg whitespace-cleanup-mode)
(global-whitespace-cleanup-mode 1)
(:with-hook before-save-hook
(:hook delete-trailing-whitespace))
(:hide-mode))
(provide 'mf-pkg-editing)

@ -0,0 +1,135 @@
;;;; -*- lexical-binding: t; -*-
(defvar mf/cl-implementations
'((sbcl ("sbcl.sh"))
(sbcl-renderdoc ("sbcl-renderdoc.sh"))))
(defvar mf/clhs-dir
(file-name-as-directory (expand-file-name "~/.data/common-lisp/clhs")))
(defun mf/sly-ask ()
(interactive)
(let ((current-prefix-arg '-))
(sly nil nil t)))
(setup (:pkg sly)
(:load-after smartparens
(:load-after sly
(:pkg sly-macrostep)
(:pkg sly-repl-ansi-color)
(push 'sly-repl-ansi-color sly-contribs))
(sly-setup '(sly-fancy))
(setq common-lisp-hyperspec-root mf/clhs-dir)
(setq sly-command-switch-to-existing-lisp 'always)
(setq sly-complete-symbol-function 'sly-flex-completions)
(setq sly-enable-evaluate-in-emacs t)
(setq sly-kill-without-query-p t)
(setq sly-lisp-implementations mf/cl-implementations)
(setq sly-mrepl-history-file-name (mf/etc-file "sly-repl-history"))
(setq sly-net-coding-system 'utf-8-unix)
(:with-map sly-mrepl-mode-map
(:with-state insert
(:bind [S-return] newline-and-indent
[up] sly-mrepl-previous-input-or-button
[down] sly-mrepl-next-input-or-button)))
(:with-map sly-inspector-mode-map
(:with-state normal
(:bind [return] push-button
[M-return] sly-mrepl-copy-part-to-repl
"gb" sly-inspector-pop
"h" sly-inspector-history
"i" sly-inspector-describe-inspectee
"p" sly-button-pretty-print)))
(:hide-mode)))
(setup lisp-mode
(:load-after sly
(define-local-keys lisp-mode-map
"'" '(sly :wk "sly")
";" `(mf/sly-ask :wk "sly (ask)"))
(define-local-keys lisp-mode-map
:infix "c"
"" '(:ignore t :wk "compile")
"c" '(sly-compile-file :wk "compile file")
"C" '(sly-compile-and-load-file :wk "compile/load file")
"f" '(sly-compile-defun :wk "compile top-level form")
"l" '(sly-load-file :wk "load file")
"n" '(sly-remove-notes :wk "remove notes")
"r" '(sly-compile-region :wk "compile region"))
(define-local-keys lisp-mode-map
:infix "e"
"" '(:ignore t :wk "evaluate")
"b" '(sly-eval-buffer :wk "buffer")
"e" '(sly-eval-last-expression :wk "last expression")
"f" '(sly-eval-defun :wk "function")
"F" '(sly-undefine-function :wk "undefine function")
"r" '(sly-eval-region :wk "region"))
(define-local-keys lisp-mode-map
:infix "g"
"" '(:ignore t :wk "go")
"b" '(sly-pop-find-definition-stack :wk "back")
"d" '(sly-edit-definition :wk "definition")
"D" '(sly-edit-definition-other-window :wk "definition (other window)")
"n" '(sly-next-note :wk "next note")
"N" '(sly-previous-note :wk "previous note")
"s" '(sly-stickers-next-sticker :wk "next sticker")
"S" '(sly-stickers-prev-sticker :wk "previous sticker"))
(define-local-keys lisp-mode-map
:infix "h"
"" '(:ignore t :wk "help")
"<" '(sly-who-calls :wk "who calls")
">" '(sly-calls-who :wk "calls who")
"~" '(hyperspec-lookup-format :wk "lookup format directive")
"#" '(hyperspec-lookup-reader-macro :wk "lookup reader macro")
"a" '(sly-apropos :wk "apropos")
"b" '(sly-who-binds :wk "who binds")
"d" '(sly-disassemble-symbol :wk "disassemble symbol")
"h" '(sly-describe-symbol :wk "describe symbol")
"H" '(sly-hyperspec-lookup :wk "hyperspec lookup")
"m" '(sly-who-macroexpands :wk "who macro-expands")
"p" '(sly-apropos-package :wk "apropos package")
"r" '(sly-who-references :wk "who references")
"s" '(sly-who-specializes :wk "who specializes")
"S" '(sly-who-sets :wk "who sets"))
(define-local-keys (emacs-lisp-mode-map sly-mrepl-mode-map lisp-mode-map)
:infix "l"
"" '(:ignore t :wk "lisp")
"a" '(sp-absorb-sexp :wk "absorb")
"b" '(sp-forward-barf-sexp :wk "barf forward")
"B" '(sp-backward-barf-sexp :wk "barf backward")
"c" '(sp-convolute-sexp :wk "convolute")
"e" '(sp-splice-sexp-killing-backward :wk "splice killing backward")
"E" '(sp-splice-sexp-killing-forward :wk "splice killing forward")
"j" '(sp-join-sexp :wk "join")
"r" '(sp-raise-sexp :wk "raise")
"s" '(sp-forward-slurp-sexp :wk "slurp forward")
"S" '(sp-backward-slurp-sexp :wk "slurp backward")
"t" '(sp-transpose-sexp :wk "transpose")
"w" '(sp-wrap-round :wk "wrap")
"W" '(sp-unwrap-sexp :wk "unwrap"))
(define-local-keys (lisp-mode-map emacs-lisp-mode-map)
"m" '(macrostep-expand :wk "macro expand"))
(define-local-keys lisp-mode-map
:infix "r"
"" '(:ignore t :wk "repl")
"c" '(sly-mrepl-clear-repl :wk "clear")
"q" '(sly-quit-lisp :wk "quit")
"r" '(sly-restart-inferior-lisp :wk "restart")
"s" '(sly-mrepl-sync :wk "sync"))
(define-local-keys lisp-mode-map
:infix "s"
"" '(:ignore t :wk "stickers")
"b" '(sly-stickers-toggle-break-on-stickers :wk "toggle break")
"c" '(sly-stickers-clear-defun-stickers :wk "clear function")
"C" '(sly-stickers-clear-buffer-stickers :wk "clear buffer")
"f" '(sly-stickers-fetch :wk "fetch")
"r" '(sly-stickers-replay :wk "replay")
"s" '(sly-stickers-dwim :wk "add/remove"))
(define-local-keys lisp-mode-map
:infix "t"
"" '(:ignore t :wk "trace")
"t" '(sly-toggle-trace-fdefinition :wk "toggle")
"T" '(sly-toggle-fancy-trace :wk "toggle (fancy)")
"u" '(sly-untrace-all :wk "untrace all"))))
(provide 'mf-pkg-lang-common-lisp)

@ -0,0 +1,34 @@
;;;; -*- lexical-binding: t; -*-
(setup elisp-mode
(:with-mode (emacs-lisp-mode lisp-interaction-mode)
(:bind "C-c C-c" eval-defun))
(:with-mode emacs-lisp-mode
(:advise eval-region :around (fn beg end &rest args)
(let ((pulse-flag t))
(pulse-momentary-highlight-region beg end))
(apply fn beg end args))))
(setup (:pkg elisp-slime-nav)
(:load-after ielm
(:hook-into emacs-lisp-mode ielm-mode)
(:hide-mode)))
(setup (:pkg ielm)
(:load-after comint
(:with-map ielm-map
(:bind [up] comint-previous-input
[down] comint-next-input))))
(setup (:pkg macrostep)
(:with-state normal
(:with-map macrostep-keymap
(:bind [tab] macrostep-next-macro
[backtab] macrostep-prev-macro
"c" macrostep-collapse
"e" macrostep-expand
"q" macrostep-collapse-all)))
(:with-hook macrostep-mode-hook
(:hook evil-normalize-keymaps)))
(provide 'mf-pkg-lang-elisp)

@ -0,0 +1,54 @@
;;;; -*- lexical-binding: t; -*-
(setup (:pkg evil-cleverparens)
(setq evil-cleverparens-swap-move-by-word-and-symbol t)
(setq evil-cleverparens-use-additional-bindings nil)
(setq evil-cleverparens-use-regular-insert t)
(:load-after (evil smartparens evil-smartparens)
(:hook-into emacs-lisp-mode
eval-expression-minibuffer-setup
ielm-mode
lisp-interaction-mode
lisp-mode
sly-mrepl-mode)
(:hide-mode)))
(setup (:pkg evil-smartparens)
(:load-after (evil smartparens)
(:hook-into smartparens-enabled-hook)
(:hide-mode)))
(setup (:pkg rainbow-delimiters)
(setq rainbow-delimiters-max-face-count 2)
(:hook-into emacs-lisp-mode-hook
eval-expression-minibuffer-setup-hook
ielm-mode-hook
lisp-interaction-mode-hook
lisp-mode-hook
sly-mrepl-mode-hook))
(setup (:pkg smartparens)
(:require smartparens)
(setq sp-cancel-autoskip-on-backward-movement nil)
(setq sp-highlight-pair-overlay nil)
(setq sp-highlight-wrap-overlay nil)
(setq sp-highlight-wrap-tag-overlay nil)
(setq sp-max-pair-length 2)
(setq sp-max-prefix-length 32)
(setq sp-message-width nil)
(setq sp-navigate-consider-sgml-tags nil)
(setq sp-navigate-skip-match nil)
(setq sp-show-pair-from-inside t)
(sp-pair "'" nil :actions :rem)
(sp-pair "`" nil :actions :rem)
(sp-pair "(" nil :unless '(:rem sp-point-before-word-p))
(:with-hook (emacs-lisp-mode-hook
eval-expression-minibuffer-setup-hook
ielm-mode-hook
lisp-interaction-mode-hook
lisp-mode-hook
sly-mrepl-mode-hook)
(:hook smartparens-strict-mode))
(:hide-mode))
(provide 'mf-pkg-lang-lisp)

@ -0,0 +1,90 @@
;;;; -*- lexical-binding: t; -*-
(setup (:pkg org)
(setq org-capture-bookmark nil)
(setq org-capture-templates
'(("c" "Code Task" entry
(file+headline org-default-notes-file "Coding Tasks")
"* TODO %?\n Entered on: %U - %a\n")
("t" "Task" entry (file+headline org-default-notes-file "Tasks")
"* TODO %?\n Entered on: %U")
("n" "Note" entry (file+olp+datetree org-default-notes-file)
"* %?\n\n")))
(setq org-catch-invisible-edits 'show-and-error)
(setq org-cycle-separator-lines 2)
(setq org-directory (file-name-as-directory
(expand-file-name "~/Projects/Org")))
(setq org-default-notes-file (expand-file-name "notes.org" org-directory))
(setq org-edit-src-content-indentation 2)
(setq org-ellipsis "")
(setq org-fontify-quote-and-verse-blocks t)
(setq org-hide-block-startup nil)
(setq org-hide-emphasis-markers t)
(setq org-html-todo-kwd-class-prefix "keyword ")
(setq org-outline-path-complete-in-steps nil)
(setq org-refile-targets '((nil :maxlevel . 3)
(org-agenda-files :maxlevel . 3)))
(setq org-refile-use-outline-path t)
(setq org-return-follows-link t)
(setq org-src-fontify-natively t)
(setq org-src-preserve-indentation t)
(setq org-src-tab-acts-natively t)
(setq org-startup-folded 'content)
(setq org-startup-indented t)
(setq org-todo-keywords
'((sequence "TODO(t)" "INPROGRESS(i)" "|" "DONE(d)")
(sequence "WAITING(w@/!)" "HOLD(h@/!)" "|" "CANCELLED(c@/!)")
(sequence "REPORTED(r@/!)" "BUG(b@/!)" "|" "FIXED(f@/!)")))
(setq org-todo-keyword-faces
'(("TODO" :foreground "dodger blue" :weight bold)
("INPROGRESS" :foreground "spring green" :weight bold)
("WAITING" :foreground "yellow" :weight bold)
("HOLD" :foreground "yellow" :weight bold)
("DONE" :foreground "forest green" :weight bold)
("CANCELLED" :foreground "forest green" :weight bold)
("REPORTED" :foreground "red" :weight bold)
("BUG" :foreground "red" :weight bold)
("FIXED" :foreground "forest green" :weight bold)))
(:hook (fn (auto-fill-mode 0)
(visual-line-mode 1))))
(setup (:pkg org-appear)
(:load-after org
(setq org-appear-autolinks t)
(:hook-into org-mode)))
(setup org-indent
(:load-after (org evil)
(setq evil-auto-indent nil)
(:hide-mode)))
(setup (:pkg (org-roam :files (:defaults "extensions/*")))
(setq org-roam-v2-ack t)
(:load-after org))
(setup (:pkg org-superstar)
(:load-after org
(setq org-superstar-headline-bullets-list '("" "" "" "" "" "" ""))
(setq org-superstar-remove-leading-stars t)
(:hook-into org-mode)))
(setup org-tempo
(:load-after org
(add-to-list 'org-structure-template-alist '("cl" . "src common-lisp"))
(add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp"))
(add-to-list 'org-structure-template-alist '("li" . "src lisp"))
(add-to-list 'org-structure-template-alist '("sh" . "src sh"))))
(setup (:pkg toc-org)
(:load-after org
(:hook-into org-mode)))
(setup (:pkg evil-org)
(:load-after (evil org)
(:hook-into org-mode)
(:require evil-org-agenda)
(evil-org-set-key-theme
'(navigation insert textobjects additional calendar))
(evil-org-agenda-set-keys)))
(provide 'mf-pkg-lang-org)

@ -0,0 +1,49 @@
;;;; -*- lexical-binding: t; -*-
(setup (:pkg git-timemachine)
(:with-state normal
(:bind "[" git-timemachine-show-previous-revision
"]" git-timemachine-show-next-revision
"b" git-timemachine-blame)))
(setup (:pkg magit)
(:pkg magit-todos)
(setq git-commit-summary-max-length 120)
(setq magit-delete-by-moving-to-trash nil)
(setq magit-display-buffer-function
#'magit-display-buffer-same-window-except-diff-v1)
(setq magit-log-auto-more t)
(setq magit-log-margin-show-committer-date t)
(setq magit-revert-buffers 'silent)
(setq magit-save-repository-buffers 'dontask)
(setq magit-wip-after-apply-mode t)
(setq magit-wip-after-save-mode t)
(setq magit-wip-before-change-mode t)
(setq transient-values
'((magit-log:magit-log-mode "--graph" "--color" "--decorate")))
(magit-wip-mode 1)
(magit-todos-mode 1)
(:hide-mode magit-wip))
(setup (:pkg persp-projectile)
(:load-after (perspective projectile)))
(setup (:pkg perspective)
(setq persp-modestring-short t)
(setq persp-show-modestring t)
(persp-mode 1))
(setup (:pkg projectile)
(setq projectile-cache-file (mf/etc-file "projectile.cache"))
(setq projectile-kill-buffers-filter 'kill-only-files)
(setq projectile-known-projects-file (mf/etc-file "projectile-bookmarks"))
(projectile-mode 1)
(setq projectile-find-dir-includes-top-level t)
(setf projectile-globally-ignored-directories
(delete-dups (append projectile-globally-ignored-directories
mf/ignored-directories)))
(setq projectile-globally-ignored-file-suffixes mf/ignored-suffixes)
(:with-idle-delay 15 (quiet! (projectile-cleanup-known-projects)))
(:hide-mode))
(provide 'mf-pkg-project)

@ -0,0 +1,21 @@
;;;; -*- lexical-binding: t; -*-
(setup show-startup-time
(:with-hook emacs-startup-hook
(:hook mf/show-startup-time)))
(setup (:pkg auto-compile)
(auto-compile-on-load-mode 1)
(auto-compile-on-save-mode 1))
(setup (:pkg gcmh)
(setq gcmh-auto-idle-delay-factor 10)
(setq gcmh-high-cons-threshold (* 128 1024 1024))
(setq gcmh-idle-delay 'auto)
(gcmh-mode 1)
(:hide-mode))
(setup (:pkg no-littering)
(:require no-littering))
(provide 'mf-pkg-startup)

@ -0,0 +1,157 @@
;;;; -*- lexical-binding: t; -*-
(setup (:pkg all-the-icons)
(:load-after marginalia
(:pkg all-the-icons-completion)
(all-the-icons-completion-mode 1)
(:with-mode marginalia-mode
(:hook all-the-icons-completion-marginalia-setup)))
(:load-after dired
(:pkg all-the-icons-dired)
(:with-mode dired-mode
(:hook all-the-icons-dired-mode))))
(setup (:pkg centaur-tabs)
(:require centaur-tabs)
(setq centaur-tabs-adjust-buffer-order t)
(setq centaur-tabs-cycle-scope 'tabs)
(setq centaur-tabs-gray-out-icons 'buffer)
(setq centaur-tabs-height 28)
(setq centaur-tabs-modified-marker "")
(setq centaur-tabs-set-close-button nil)
(setq centaur-tabs-set-icons t)
(setq centaur-tabs-set-modified-marker t)
(setq centaur-tabs-show-new-tab-button nil)
(setq centaur-tabs-style "rounded")
(centaur-tabs-group-by-projectile-project)
(centaur-tabs-headline-match)
(centaur-tabs-mode 1)
(:bind "M-[" centaur-tabs-backward
"M-]" centaur-tabs-forward)
(:with-hook emacs-startup-hook
(:hook (fn (centaur-tabs-change-fonts "Iosevka Slab" 120))))
(defun centaur-tabs-hide-tab (x)
(let ((name (format "%s" x)))
(or (window-dedicated-p (selected-window))
(string-prefix-p "*Messages*" name)
(string-prefix-p "*scratch" name)
(string-prefix-p "*Compile-Log*" name)
(string-prefix-p "*company" name)
(string-prefix-p "*Flycheck" name)
(string-prefix-p "*tramp" name)
(string-prefix-p " *Mini" name)
(string-prefix-p "*help" name)
(string-prefix-p "*straight" name)
(string-prefix-p "*sly" name)
(string-prefix-p " *temp" name)
(string-prefix-p "*Help" name)
(string-prefix-p "magit" name)))))
(setup (:pkg default-text-scale)
(:bind "M--" default-text-scale-decrease
"M-+" default-text-scale-increase
"M-=" default-text-scale-reset)
(default-text-scale-mode 1))
(setup (:pkg diff-hl)
(global-diff-hl-mode 1)
(diff-hl-flydiff-mode 1)
(:with-mode dired-mode
(:hook diff-hl-dired-mode))
(:with-after magit
(:with-hook magit-pre-refresh-hook
(:hook diff-hl-magit-pre-refresh))
(:with-hook magit-post-refresh-hook
(:hook diff-hl-magit-post-refresh))))
(setup (:pkg dimmer)
(setq dimmer-fraction 0.3)
(dimmer-mode 1))
(setup (:pkg doom-modeline)
(setq doom-modeline-bar-width 4)
(setq doom-modeline-buffer-encoding nil)
(setq doom-modeline-buffer-file-name-style 'relative-from-project)
(setq doom-modeline-height 30)
(setq doom-modeline-irc t)
(setq doom-modeline-major-mode-icon t)
(setq doom-modeline-minor-modes t)
(:hook-into window-setup))
(setup (:pkg doom-themes)
(setq doom-themes-enable-bold t)
(setq doom-themes-enable-italic t)
(doom-themes-org-config)
(load-theme 'doom-one t))
(setup (:pkg emojify)
(:load-after erc
(:hook-into erc-mode)))
(setup (:pkg evil-goggles)
(:load-after evil
(setq evil-goggles-duration 1.0)
(setq evil-goggles-pulse nil)
(evil-goggles-mode 1)
(:hide-mode)))
(setup (:pkg helpful)
(:load-after link-hint
(:with-state normal
(:bind "o" link-hint-open-link-at-point))
(setq helpful-switch-buffer-function
(lambda (x)
(if (eq major-mode 'helpful-mode)
(switch-to-buffer x)
(pop-to-buffer x))))))
(setup (:pkg highlight-numbers)
(:hook-into prog-mode))
(setup (:pkg hl-fill-column)
(:require hl-fill-column)
(:hook-into prog-mode text-mode conf-mode))
(setup (:pkg hl-line)
(global-hl-line-mode 1))
(setup (:pkg hl-todo)
(global-hl-todo-mode 1))
(setup (:pkg marginalia)
(:load-after vertico)
(marginalia-mode 1))
(setup (:pkg rainbow-mode)
(:hook-into web-mode-hook css-mode-hook)
(:hide-mode))
(setup (:pkg solaire-mode)
(solaire-global-mode 1))
(setup (:pkg which-key)
(which-key-mode 1)
(setq which-key-add-column-padding 2)
(setq which-key-idle-delay 0.5)
(setq which-key-idle-secondary-delay 0.1)
(setq which-key-replacement-alist
'((("left") . ("🡸"))
(("right") . ("🡺"))
(("up") . ("🡹"))
(("down") . ("🡻"))
(("delete") . ("DEL"))
(("\\`DEL\\'") . ("BKSP"))
(("RET") . (""))
(("next") . ("PgDn"))
(("prior") . ("PgUp"))))
(setq which-key-max-display-columns nil)
(setq which-key-min-display-lines 6)
(setq which-key-sort-order 'which-key-key-order-alpha)
(setq which-key-sort-uppercase-first nil)
(which-key-setup-side-window-bottom)
(:with-hook which-key-init-buffer-hook
(:hook (fn (setq line-spacing 4))))
(:hide-mode))
(provide 'mf-pkg-ui)

@ -0,0 +1,39 @@
;;;; -*- lexical-binding: t; -*-
(setup (:pkg alert)
(setq alert-default-style 'libnotify))
(setup (:pkg browse-at-remote))
(setup (:pkg browse-url-dwim)
(setq browse-url-browser-function 'browse-url-xdg-open)
(setq browse-url-dwim-always-confirm-extraction nil))
(setup (:pkg general)
(:load-after evil
(general-evil-setup)
(general-create-definer define-keys
:states '(normal motion visual insert emacs))
(general-create-definer define-leader-keys
:states '(normal visual insert eemacs)
:prefix "SPC"
:non-normal-prefix "M-SPC")
(general-create-definer define-local-keys
:major-modes t
:states '(normal visual insert emacs)
:prefix ","
:non-normal-prefix "M-,")))
(setup (:pkg gist)
(setq gist-view-gist t)
(:hide-mode))
(setup (:pkg link-hint)
(:require link-hint))
(setup (:pkg rg)
(:require rg)
(setq rg-group-result t)
(setq rg-ignore-case 'smart))
(provide 'mf-pkg-util)

@ -0,0 +1,14 @@
;;;; -*- lexical-binding: t; -*-
(setup (:pkg ace-window)
(setq aw-background t)
(setq aw-scope 'frame)
(ace-window-display-mode 1))
(setup (:pkg windmove)
(windmove-default-keybindings))
(setup (:pkg winner)
(winner-mode 1))
(provide 'mf-pkg-window)

@ -0,0 +1,133 @@
;;;; -*- lexical-binding: t; -*-
;; Install setup.el. We use this to concisely perform repetitive tasks, such as
;; installing and loading packages.
(straight-use-package '(setup :repo "https://git.sr.ht/~pkal/setup"))
(require 'setup)
(defmacro define-setup-macro (name signature &rest body)
"Shorthand for 'setup-define'. NAME is the name of the local macro. SIGNATURE
is used as the argument list for FN. If BODY starts with a string, use this as
the value for :documentation. Any following keywords are passed as OPTS to
'setup-define'."
(declare (debug defun))
(let (opts)
(when (stringp (car body))
(setq opts (nconc (list :documentation (pop body)) opts)))
(while (keywordp (car body))
(let ((prop (pop body))
(val `',(pop body)))
(setq opts (nconc (list prop val) opts))))
`(setup-define ,name
(cl-function (lambda ,signature ,@body))
,@opts)))
;;; ============================================================================
;;; Custom setup.el local macros
;;; ============================================================================
(define-setup-macro :pkg (recipe)
"Install RECIPE with 'straight-use-package'. This macro can be used as HEAD,
and will replace itself with the first RECIPE's package."
:repeatable t
:shorthand (lambda (x)
(let ((recipe (cadr x)))
(if (consp recipe)
(car recipe)
recipe)))
`(straight-use-package ',recipe))
(define-setup-macro :hide-mode (&optional mode)
"Hide the mode-line lighter of the current mode. Alternatively, MODE can be
specified manually, and override the current mode."
:after-loaded t
(let ((mode (or mode (setup-get 'mode))))
`(progn
(setq minor-mode-alist
(remq (assq ',(intern (format "%s-mode" mode)) minor-mode-alist)
minor-mode-alist))
(setq minor-mode-alist
(remq (assq ',mode minor-mode-alist)
minor-mode-alist)))))
(define-setup-macro :load-after (features &rest body)
"Load the current feature after FEATURES."
:indent 1
(let ((body `(progn
(require ',(setup-get 'feature))
,@body)))
(dolist (feature (nreverse (ensure-list features)))
(setq body `(with-eval-after-load ',feature ,body)))
body))
(define-setup-macro :with-after (features &rest body)
"Evaluate BODY after FEATURES are loaded."
:indent 1
(let ((body `(progn ,@body)))
(dolist (feature (nreverse (ensure-list features)))
(setq body `(with-eval-after-load ',feature ,body)))
body))
(define-setup-macro :with-state (state &rest body)
"Change the evil STATE that BODY will bind to. If STATE is a list, apply BODY
to all elements of STATE. This is intended to be used with ':bind'."
:indent 1
:debug '(sexp setup)
(let (bodies)
(dolist (state (ensure-list state))
(push (let ((setup-opts (cons `(state . ,state) setup-opts)))
(setup-expand body))
bodies))
(macroexp-progn (nreverse bodies))))
(define-setup-macro :bind (key command)
"Bind KEY to COMMAND in current map, and optionally for current evil states."
:after-loaded t
:debug '(form sexp)
:repeatable t
(let ((