From 80abceb212b2acb420317232cb2c3d0ab69af13b Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 27 May 2022 13:26:19 -0500 Subject: asdpofiuasdpfoiasjdpfoiajsdf --- init.el | 130 ++++++++++++++++++++-------------------------------------------- 1 file changed, 41 insertions(+), 89 deletions(-) (limited to 'init.el') diff --git a/init.el b/init.el index 9bd342b..2932768 100644 --- a/init.el +++ b/init.el @@ -38,7 +38,8 @@ ;; good functioning. In this block, I add extra things or more "experimental" ;; ones that might not belong in a separate file. (:also-load +lisp) - (:option truncate-string-ellipsis "…") + (:option truncate-string-ellipsis "…" + ring-bell-function 'ignore) ;; Bindings (:global "C-x C-k" #'kill-current-buffer "C-x 4 n" #'clone-buffer @@ -52,7 +53,7 @@ "C-x C-m" #'execute-extended-command ; original: coding systems "C-" #'+backward-kill-word "C-x TAB" #'+indent-rigidly - "C-x C-c" nil) + "C-x C-c" #'+save-buffers-quit) ;; C-h deletes backward - see https://idiomdrottning.org/bad-emacs-defaults (global-set-key (kbd "C-h") 'delete-backward-char) (keyboard-translate ?\C-h ?\C-?) @@ -105,8 +106,8 @@ (dolist (var '(safe-local-variable-values warning-suppress-types)) (add-to-list '+custom-variable-allowlist var)) - (+ensure-after-init - (+custom-load-ignoring-most-customizations)) + (+with-ensure-after-init + (+custom-load-ignoring-most-customizations)) (advice-add #'custom-buffer-create-internal :after #'+cus-edit-expand-widgets) (:with-mode Custom-mode (:local-set imenu-generic-expression +cus-edit-imenu-generic-expression))) @@ -147,7 +148,7 @@ (+ensure-after-init #'+key-global-mode)) (setup _work - (+with-ensure-after-init + (with-eval-after-load 'bbdb (require '_work))) (setup abbrev @@ -672,12 +673,13 @@ (:global [f8] #'org-clock-in [f9] #'org-clock-out "C-c l" #'org-store-link) - (:hook #'variable-pitch-mode + (+with-ensure-after-init + (:hook #'variable-pitch-mode #'visual-fill-column-mode #'turn-off-auto-fill #'org-indent-mode #'prettify-symbols-mode - #'+org-wrap-on-hyphens) + #'+org-wrap-on-hyphens)) (:local-set prettify-symbols-alist '(("DEADLINE:" . ?→) ("SCHEDULED:" . ?↷) ("CLOSED:" . ?✓)) @@ -974,12 +976,10 @@ (setq affe-regexp-compiler (defun affe-orderless-regexp-compiler (input &rest _) (setq input (orderless-pattern-compiler input)) (cons input (lambda (str) (orderless--highlight input str))))) - (+with-eval-after-loads (affe vertico-multiform) + (+with-eval-after-loads (affe) (setq affe-regexp-compiler (defun affe-orderless-regexp-compiler (input &rest _) (setq input (orderless-pattern-compiler input)) (cons input (lambda (str) (orderless--highlight input str))))) - (setf (alist-get 'affe-grep vertico-multiform-commands) nil - (alist-get 'affe-find vertico-multiform-commands) nil) (:+key "M-s g" #'affe-grep "M-s f" #'affe-find))) @@ -1262,10 +1262,7 @@ column-number-mode nil file-percentage-mode nil visual-fill-column-extra-text-width - (cons +circe-left-margin 0)) - (with-eval-after-load 'vertico-multiform - (setf (alist-get 'lui-next-button-or-complete vertico-multiform-commands) - '(flat)))) + (cons +circe-left-margin 0))) (tracking-mode +1) (:with-mode tracking-mode @@ -1383,41 +1380,10 @@ (comint-mode-map . comint-mode-hook) (sly-mrepl-mode-map . sly-mrepl-hook))) (with-eval-after-load 'orderless - (:option consult--regexp-compiler #'consult--orderless-regexp-compiler)) - (with-eval-after-load 'vertico-multiform - (setf (alist-get 'consult-buffer vertico-multiform-commands) '(flat)) - (dolist (buf-cmd '(consult-find - consult-flymake - consult-focus-lines - consult-git-grep - consult-grep - consult-imenu - consult-imenu-multi - consult-keep-lines - consult-line - consult-line-multi - consult-locate - consult-multi-occur - consult-outline - consult-ripgrep - consult-yank-pop)) - (setf (alist-get buf-cmd vertico-multiform-commands) nil))))) - -(setup (:straight consult-dir) - (:load-after consult) - (:+key "C-x C-d" #'consult-dir) - (:with-map vertico-map - (:bind "C-x C-d" #'consult-dir - "C-x C-j" #'consult-dir-jump-file))) - -(setup (:straight consult-notmuch) - (:load-after consult notmuch) - (with-eval-after-load 'vertico-multiform - (setf (alist-get 'consult-notmuch vertico-multiform-commands) nil - (alist-get 'consult-notmuch-tree vertico-multiform-commands) nil))) + (:option consult--regexp-compiler #'consult--orderless-regexp-compiler)))) (setup (:straight corfu) - (corfu-global-mode +1)) + (global-corfu-mode +1)) (setup (:straight crossword) ;; This isn't the perfect Emacs crossword puzzle, but it's the only one I @@ -1587,11 +1553,7 @@ (:bind "C-." #'embark-act "M-." #'embark-dwim)) (:with-map embark-file-map - (:bind "l" #'vlf)) - ;; Integrations - (with-eval-after-load 'vertico-multiform - (setf (alist-get 'embark-prefix-help-command vertico-multiform-commands) - nil))) + (:bind "l" #'vlf))) (setup (:straight embark-consult) (:load-after consult embark) @@ -1687,9 +1649,7 @@ (:option flyspell-correct--cr-key ";") (:bind-into flyspell "C-;" #'flyspell-correct-wrapper - "" #'+flyspell-correct-buffer) - (with-eval-after-load 'vertico-multiform - (setf (alist-get 'flyspell vertico-multiform-categories) nil))) + "" #'+flyspell-correct-buffer)) (setup (:straight focus) (:require) @@ -1765,12 +1725,6 @@ " v" #'helpful-variable " k" #'helpful-key " ." #'helpful-at-point) - (with-eval-after-load 'vertico-multiform - (dolist (cmd '(describe-symbol ; describe-* included here for completeness - describe-function describe-variable - helpful-function helpful-macro helpful-callable - helpful-variable)) - (setf (alist-get cmd vertico-multiform-commands) nil))) ;; Load faster on first invocation by pre-loading a slow function ;; (see https://github.com/Wilfred/helpful/issues/236) (run-with-idle-timer 1 nil (lambda () @@ -1778,8 +1732,8 @@ (info-lookup-setup-mode 'symbol 'emacs-lisp-mode)))) (setup (:straight (hippie-completing-read - :host github - :repo "duckwork/hippie-completing-read")) + :host nil + :repo "https://codeberg.org/acdw/hippie-completing-read.el")) (:+key "M-/" #'hippie-completing-read)) (setup (:straight hungry-delete) @@ -1918,10 +1872,7 @@ (keychain-refresh-environment)) (setup (:straight lacarte) - (:+key "" #'lacarte-execute-menu-command) - (with-eval-after-load 'vertico-multiform - (setf (alist-get 'lacarte-execute-menu-command vertico-multiform-commands) - '(buffer grid (vertico-sort-function . vertico-sort-length-alpha))))) + (:+key "" #'lacarte-execute-menu-command)) (setup (:straight (lin :host nil :repo "https://git.sr.ht/~protesilaos/lin")) @@ -1967,7 +1918,11 @@ lisp-interaction-mode-map)) (define-key (symbol-value m) (kbd "C-c e") #'macrostep-expand))) -(setup (:straight (magit :host github :repo "magit/magit"))) +(setup (:straight (magit :host github :repo "magit/magit" + :build (:not compile)) + (:straight (transient :host github :repo "magit/transient" + :build (:not compile)))) + (autoload 'transient--with-suspended-override "transient")) (setup (:straight marginalia) (marginalia-mode +1)) @@ -2098,12 +2053,13 @@ ((,class :inherit font-lock-comment-face :foreground ,fg-header :background ,yellow-intense-bg))) - `(mode-line - ((,class :height 100))) - `(mode-line-inactive - ((,class :height 100))) - `(tab-bar - ((,class :height 100))))))) + ;; `(mode-line + ;; ((,class :height 100))) + ;; `(mode-line-inactive + ;; ((,class :height 100))) + ;; `(tab-bar + ;; ((,class :height 100))) + )))) (require 'dawn) (dawn-schedule #'modus-themes-load-operandi @@ -2140,6 +2096,13 @@ (:hook #'visual-fill-column-mode) (:file-match (rx ".epub" eos))) +(setup (:straight nyan-mode) + (:require) + ;; For some reason, in some modes the mode-line isn't updated after these + ;; commands. I think it might have to do with `+modeline-position-function'. + (advice-add 'end-of-buffer :after #'force-mode-line-update) + (advice-add 'beginning-of-buffer :after #'force-mode-line-update)) + (setup (:straight ol-notmuch)) (setup (:straight orderless) @@ -2342,6 +2305,7 @@ +modeline-major-mode (lambda () (+modeline-vc " : ")) +modeline-anzu + +modeline-nyan-on-focused ) ( ; right simple-modeline-segment-process @@ -2350,7 +2314,6 @@ (+modeline-concat '(+modeline-track simple-modeline-segment-misc-info)))) - simple-modeline-segment-process ,(+modeline-concat '(+modeline-god-mode +modeline-kmacro-indicator @@ -2360,7 +2323,7 @@ +modeline-input-method) " ") +modeline-position - ;; +modeline-spacer + +modeline-spacer ))) (simple-modeline-mode +1)) @@ -2483,7 +2446,8 @@ (setup (:straight (twtxt :fork (:repo "duckwork/twtxt-el"))) (:option twtxt-file "/sshx:hetzner:/var/www/acdw.casa/tw.txt" - twtxt-following '(("acdw" "https://acdw.casa/tw.txt")))) + twtxt-following '(("acdw" "https://acdw.casa/tw.txt"))) + (+with-ensure-after-init (:require))) (setup (:straight undo-fu) (:option undo-fu-allow-undo-in-region t) @@ -2533,20 +2497,8 @@ ;; Extensions (:also-load vertico-directory vertico-mouse - vertico-unobtrusive - vertico-multiform vertico-quick) (vertico-mouse-mode +1) - (vertico-multiform-mode +1) - ;; I `setf' these so they don't override the other setfs elsewhere in init.el. - (setf (alist-get 'execute-extended-command vertico-multiform-commands) '(flat)) - (setf (alist-get 'completion-at-point vertico-multiform-commands) '(flat)) - (setf (alist-get 'indent-for-tab-command vertico-multiform-commands) '(flat)) - (setf (alist-get 'insert-char vertico-multiform-commands) nil) - (setf (alist-get 'file vertico-multiform-categories) nil) - (setf (alist-get 'bookmark vertico-multiform-categories) nil) - ;; Default. Needs to be `add-to-list' so that it appears at the end. - (add-to-list 'vertico-multiform-categories '(t flat) :append) (:with-map vertico-map (:bind "RET" #'vertico-directory-enter "DEL" #'vertico-directory-delete-char -- cgit 1.4.1-21-gabe81