files related to my current emacs configuration
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: add vertico, marginalia and consult packages. simplify add-package macro

Signed-off-by: Amy <amy+git@amogus.cloud>

Amy 46d87125 bfdcb566

+30 -17
+30 -17
.emacs
··· 10 10 ;;; macros 11 11 (defmacro amy/add-package (name &optional should-require) 12 12 "Add a package by `NAME' and automatically require it if `SHOULD-REQUIRE' is not nil." 13 - (if should-require 14 - `(progn (unless (package-installed-p ,name) 15 - (package-install ,name)) 16 - (require ,name)) 17 - `(unless (package-installed-p ,name) 18 - (package-install ,name)))) 13 + `(progn (unless (package-installed-p (quote ,name)) 14 + (package-install (quote ,name))) 15 + ,(when should-require 16 + `(require (quote ,name))))) 19 17 20 18 (defmacro amy/set-key (key func) 21 19 "Wrapper of `global-set-key' for setting keybinds without directly using the `kbd' function. ··· 88 86 (package-initialize) 89 87 90 88 ;;; Shell env 91 - (amy/add-package 'exec-path-from-shell t) 89 + (amy/add-package exec-path-from-shell t) 92 90 (when (memq window-system '(mac ns x pgtk)) 93 91 (exec-path-from-shell-initialize)) 94 92 95 93 ;;; theme 96 - (amy/add-package 'spacemacs-theme) 94 + (amy/add-package spacemacs-theme) 97 95 (load-theme 'spacemacs-light t) 98 96 99 97 ;; code-editing 100 - (amy/add-package 'multiple-cursors t) 98 + (amy/add-package multiple-cursors t) 101 99 (amy/set-key "C-S-c C-S-c" 'mc/edit-lines) 102 100 (amy/set-key "C->" 'mc/mark-next-like-this) 103 101 (amy/set-key "C-<" 'mc/mark-previous-like-this) 104 102 (amy/set-key "C-c C-<" 'mc/mark-all-like-this) 105 103 106 - (amy/add-package 'paredit t) 104 + (amy/add-package paredit t) 107 105 (amy/add-hooks (emacs-lisp-mode lisp-mode clojure-mode) 108 106 #'paredit-mode) 109 107 110 - (amy/add-package 'flycheck t) 111 - (amy/add-package 'flycheck-eglot) 108 + (amy/add-package flycheck t) 109 + (amy/add-package flycheck-eglot) 112 110 (require 'eglot) 113 111 114 112 ;; Install pre-compiled language grammars 115 - (amy/add-package 'treesit-langs t) 113 + (amy/add-package treesit-langs t) 116 114 (treesit-langs-major-mode-setup) 117 115 118 116 ;; TODO: get rid of all of these add-to-list statements ··· 137 135 (with-eval-after-load 'eglot 138 136 (add-to-list 'eglot-server-programs '(js-base-mode . ("typescript-language-server" "--stdio")))) 139 137 140 - (amy/add-package 'slime t) 138 + (amy/add-package slime t) 141 139 (setq inferior-lisp-program "sbcl") 142 140 143 - (amy/add-package 'cider t) 141 + (amy/add-package cider t) 144 142 145 - (amy/add-package 'corfu t) 143 + (amy/add-package corfu t) 146 144 (global-corfu-mode) 147 145 (corfu-history-mode) 148 146 (corfu-echo-mode) ··· 162 160 (keymap-set corfu-map "TAB" #'corfu-next) 163 161 (keymap-set corfu-map "S-TAB" #'corfu-previous) 164 162 165 - (amy/add-package 'cape t) 163 + (amy/add-package cape t) 166 164 (add-to-list 'completion-at-point-functions #'cape-file) 167 165 (add-to-list 'completion-at-point-functions #'cape-dabbrev) 168 166 169 167 (with-eval-after-load 'cape 170 168 (advice-add 'pcomplete-completions-at-point :around #'cape-wrap-silent) 171 169 (advice-add 'pcomplete-completions-at-point :around #'cape-wrap-purify)) 170 + 171 + ;; Minibuffer 172 + (amy/add-package vertico t) 173 + (setq vertico-cycle t 174 + vertico-resize nil) 175 + 176 + (vertico-mode) 177 + (amy/add-package marginalia t) 178 + (marginalia-mode) 179 + 180 + (amy/add-package consult t) 181 + 182 + (amy/set-key "C-x b" #'consult-buffer) 183 + (amy/set-key "C-C C-x b" #'consult-buffer-other-window) 184 + 172 185 173 186 ;; Dired config 174 187 (setq dired-listing-switches "-al --group-directories-first")