2022-12-16 10:27:53 -08:00
|
|
|
;;; EMACS init file -*- lexical-binding:t -*-
|
|
|
|
|
2023-03-14 21:26:01 -07:00
|
|
|
(eval-and-compile
|
|
|
|
(defconst my-is-nixos (file-exists-p "/nix")
|
|
|
|
"Whether or not Emacs is running on NixOS."))
|
2023-03-08 22:34:06 -08:00
|
|
|
|
|
|
|
(when my-is-nixos
|
|
|
|
(setq auth-sources '("/run/agenix/authinfo")))
|
|
|
|
|
2023-03-21 10:07:26 -07:00
|
|
|
(require 'cl-lib)
|
|
|
|
|
2023-01-19 22:06:08 -08:00
|
|
|
(with-eval-after-load 'package
|
|
|
|
(add-to-list 'package-archives
|
|
|
|
'("melpa" . "https://melpa.org/packages/"))
|
|
|
|
(package-initialize))
|
2022-12-16 10:27:53 -08:00
|
|
|
|
2023-03-08 22:34:06 -08:00
|
|
|
(setq use-package-always-ensure (not my-is-nixos)
|
2022-12-21 17:40:08 -08:00
|
|
|
use-package-always-defer t
|
2022-12-16 10:27:53 -08:00
|
|
|
use-package-expand-minimally t)
|
|
|
|
(require 'use-package)
|
|
|
|
|
|
|
|
(let ((emacs-tmp-dir (expand-file-name (format "emacs%d" (user-uid))
|
|
|
|
temporary-file-directory)))
|
|
|
|
(setq auto-save-file-name-transforms `((".*" ,emacs-tmp-dir t))
|
|
|
|
auto-save-list-file-prefix emacs-tmp-dir
|
|
|
|
backup-directory-alist (setq undo-tree-history-directory-alist
|
|
|
|
`((".*" . ,emacs-tmp-dir)))
|
|
|
|
org-preview-latex-image-directory (expand-file-name "ltximg" emacs-tmp-dir)))
|
|
|
|
|
|
|
|
(setq backup-by-copying t
|
|
|
|
inhibit-splash-screen t
|
2022-12-21 17:40:08 -08:00
|
|
|
custom-file (expand-file-name "custom.el" temporary-file-directory))
|
2022-12-16 10:27:53 -08:00
|
|
|
|
2023-08-30 23:50:45 -07:00
|
|
|
(defun my-inhibit-hl-line-mode ()
|
|
|
|
"Disable `gobal-hl-line-mode' for the current buffer."
|
|
|
|
(setq-local global-hl-line-mode nil))
|
|
|
|
|
2023-03-21 10:07:26 -07:00
|
|
|
(use-package f
|
|
|
|
:demand t)
|
2023-03-08 10:04:19 -08:00
|
|
|
|
|
|
|
(use-package dash
|
2023-03-21 10:07:26 -07:00
|
|
|
:demand t
|
2023-03-08 10:04:19 -08:00
|
|
|
:hook (emacs-lisp-mode . dash-fontify-mode)
|
|
|
|
:init
|
|
|
|
(with-eval-after-load 'info-look
|
|
|
|
(dash-register-info-lookup)))
|
|
|
|
|
2023-01-08 20:48:37 -08:00
|
|
|
(use-package undo-fu
|
2022-12-21 17:40:08 -08:00
|
|
|
:demand t
|
2022-12-16 10:27:53 -08:00
|
|
|
:config
|
2023-11-04 00:01:00 -07:00
|
|
|
(global-unset-key (kbd "C-/"))
|
|
|
|
(global-unset-key (kbd "C-?"))
|
|
|
|
(global-set-key (kbd "C-/") #'undo-fu-only-undo)
|
|
|
|
(global-set-key (kbd "C-?") #'undo-fu-only-redo))
|
2023-01-17 17:48:26 -08:00
|
|
|
|
2024-10-17 02:35:27 -07:00
|
|
|
(use-package vundo)
|
|
|
|
|
2023-11-04 00:01:00 -07:00
|
|
|
(use-package god-mode
|
2022-12-21 17:40:08 -08:00
|
|
|
:demand t
|
2023-04-03 21:05:05 -07:00
|
|
|
:bind
|
2023-11-04 00:01:00 -07:00
|
|
|
("<escape>" . god-mode-all)
|
2023-11-09 10:10:13 -08:00
|
|
|
("ESC ESC ESC" . god-mode-all)
|
2023-04-03 21:05:05 -07:00
|
|
|
("C-S-h" . help-command)
|
2023-11-04 00:01:00 -07:00
|
|
|
("C-h" . my--god-del)
|
|
|
|
(:map god-local-mode-map
|
|
|
|
("i" . god-mode-all)
|
|
|
|
("<escape>" . my--god-c-g)
|
2023-11-09 10:10:13 -08:00
|
|
|
("ESC ESC ESC" . keyboard-escape-quit)
|
2023-11-04 00:01:00 -07:00
|
|
|
("z" . repeat)
|
|
|
|
("q" . my--god-c-q))
|
|
|
|
(:map minibuffer-local-map
|
2023-11-09 10:10:13 -08:00
|
|
|
("<escape>" . abort-minibuffers)
|
|
|
|
("ESC ESC ESC" . keyboard-escape-quit))
|
2023-11-04 00:01:00 -07:00
|
|
|
:custom
|
|
|
|
(god-exempt-major-modes nil)
|
2023-11-04 12:46:20 -07:00
|
|
|
(god-exempt-predicates (list #'god-exempt-mode-p))
|
2023-11-04 00:01:00 -07:00
|
|
|
(god-mode-enable-function-key-translations nil)
|
2023-11-20 13:14:48 -08:00
|
|
|
(god-mode-alist '((nil . "C-")
|
|
|
|
("g" . "M-")
|
|
|
|
("m" . "C-M-")))
|
2023-11-04 00:01:00 -07:00
|
|
|
:config
|
|
|
|
(defun my--god-c-q ()
|
|
|
|
(interactive)
|
|
|
|
(let ((god-local-mode nil))
|
|
|
|
(if-let* ((buffer-read-only)
|
|
|
|
(ret (key-binding (read-kbd-macro "q")))
|
|
|
|
((not (or (eq ret #'self-insert-command) (and (boundp lispy-mode) lispy-mode)))))
|
|
|
|
(call-interactively ret)
|
|
|
|
(switch-to-prev-buffer))))
|
|
|
|
(cl-macrolet ((define-kmacro-wrapper (name key)
|
|
|
|
`(defun ,name ()
|
|
|
|
(interactive)
|
|
|
|
(call-interactively (key-binding (read-kbd-macro ,key))))))
|
|
|
|
(define-kmacro-wrapper my--god-del "DEL")
|
|
|
|
(define-kmacro-wrapper my--god-c-g "C-g"))
|
2023-02-07 22:22:13 -08:00
|
|
|
(with-eval-after-load 'catppuccin-theme
|
2023-11-04 00:01:00 -07:00
|
|
|
(add-hook 'god-mode-enabled-hook
|
|
|
|
(lambda ()
|
2023-11-09 10:10:13 -08:00
|
|
|
(face-spec-set 'cursor `((t (:background ,(catppuccin-get-color 'rosewater)))))
|
|
|
|
(unless (display-graphic-p)
|
2023-11-04 00:01:00 -07:00
|
|
|
(send-string-to-terminal "\e[2 q"))))
|
|
|
|
(add-hook 'god-mode-disabled-hook
|
|
|
|
(lambda ()
|
2023-11-09 10:10:13 -08:00
|
|
|
(face-spec-set 'cursor `((t (:background ,(catppuccin-get-color 'mauve)))))
|
|
|
|
(unless (display-graphic-p)
|
2023-11-04 00:01:00 -07:00
|
|
|
;; Escape codes for hbar cursor in insert mode
|
|
|
|
(send-string-to-terminal "\e[4 q")))))
|
2023-11-04 14:00:09 -07:00
|
|
|
(god-mode))
|
2022-12-16 10:27:53 -08:00
|
|
|
|
2023-11-04 16:29:34 -07:00
|
|
|
(use-package multiple-cursors
|
|
|
|
:bind
|
|
|
|
("C-S-c" . mc/edit-lines)
|
|
|
|
("C->" . mc/mark-next-like-this)
|
2023-12-14 17:32:40 -08:00
|
|
|
("C-<" . mc/mark-previous-like-this)
|
2023-11-04 16:29:34 -07:00
|
|
|
("C-+" . mc/mark-all-like-this)
|
|
|
|
("C-|" . mc/mark-pop)
|
|
|
|
("C-c c" . mc/mark-all-in-region)
|
|
|
|
("C-c C" . mc/mark-all-in-region-regexp)
|
|
|
|
("C-c u" . mc/mark-all-like-this-dwim)
|
|
|
|
("C-c U" . mc/mark-all-dwim)
|
|
|
|
("C-S-<mouse-1>" . mc/add-cursor-on-click)
|
|
|
|
:custom
|
|
|
|
(mc/always-run-for-all t)
|
|
|
|
:init
|
|
|
|
;; NOTE: For SOME REASON lispy also defvars the mc cmds list to nil when
|
|
|
|
;; sourced so they need to be modified twice
|
|
|
|
(let ((add-cmds (lambda ()
|
|
|
|
(dolist (f '(god-local-mode
|
|
|
|
god-mode-all
|
|
|
|
god-global-mode))
|
|
|
|
(add-to-list 'mc/cmds-to-run-once f)))))
|
|
|
|
;; Because multiple-cursors-core is what actually gets autoloaded
|
|
|
|
(eval-after-load 'multiple-cursors-core add-cmds)
|
|
|
|
(eval-after-load 'lispy add-cmds)))
|
|
|
|
|
|
|
|
(use-package expand-region
|
|
|
|
:bind ("C-=" . er/expand-region))
|
|
|
|
|
2023-03-27 11:15:45 -07:00
|
|
|
(use-package avy
|
|
|
|
:bind
|
|
|
|
("C-'" . avy-goto-char)
|
|
|
|
("C-," . avy-goto-char-2)
|
|
|
|
("C-\"" . avy-goto-char-timer)
|
|
|
|
("M-g f" . avy-goto-line)
|
|
|
|
("M-g w" . avy-goto-word-1)
|
2023-04-13 23:09:26 -07:00
|
|
|
("M-g e" . avy-goto-word-0)
|
|
|
|
:custom
|
2023-11-04 00:01:00 -07:00
|
|
|
(avy-timeout-seconds 0.3))
|
|
|
|
|
|
|
|
(use-package lispy
|
|
|
|
:hook
|
|
|
|
emacs-lisp-mode
|
|
|
|
ielm-mode
|
|
|
|
lisp-mode
|
|
|
|
scheme-mode
|
|
|
|
clojure-mode
|
2023-01-24 23:56:45 -08:00
|
|
|
:config
|
2023-11-04 00:01:00 -07:00
|
|
|
(add-to-list 'lispy-compat 'god-mode)
|
|
|
|
(add-to-list 'lispy-compat 'magit-blame-mode)
|
|
|
|
(when (boundp 'god-local-mode-map)
|
|
|
|
(push (assoc 'god-local-mode minor-mode-map-alist) minor-mode-map-alist)))
|
2023-01-24 23:31:15 -08:00
|
|
|
|
2023-01-09 23:03:49 -08:00
|
|
|
(use-package ace-window
|
|
|
|
:bind ("C-c w" . ace-window)
|
|
|
|
:custom
|
|
|
|
(aw-dispatch-always t)
|
2023-01-18 10:42:40 -08:00
|
|
|
(aw-scope 'frame)
|
2023-12-14 17:32:40 -08:00
|
|
|
(aw-keys '(?a ?w ?d ?f ?g ?h ?k ?l))
|
2023-01-09 23:03:49 -08:00
|
|
|
:config
|
2023-01-21 17:31:58 -08:00
|
|
|
(with-eval-after-load 'catppuccin-theme
|
|
|
|
(face-spec-set 'aw-leading-char-face `((t (:foreground
|
2023-02-07 22:22:13 -08:00
|
|
|
,(catppuccin-get-color 'crust)
|
|
|
|
:background
|
|
|
|
,(catppuccin-get-color 'red)
|
|
|
|
:weight bold))))
|
2023-01-21 17:31:58 -08:00
|
|
|
(face-spec-set 'aw-background-face `((t (:foreground
|
2023-02-07 22:22:13 -08:00
|
|
|
,(catppuccin-get-color 'overlay1)))))))
|
2023-01-09 23:03:49 -08:00
|
|
|
|
2023-01-08 22:56:09 -08:00
|
|
|
(use-package goggles
|
2023-01-24 21:34:41 -08:00
|
|
|
:hook prog-mode
|
2023-01-08 22:56:09 -08:00
|
|
|
:config
|
2023-01-12 21:45:32 -08:00
|
|
|
(setq-default goggles-pulse t)
|
|
|
|
(with-eval-after-load 'catppuccin-theme
|
2023-03-30 23:33:12 -07:00
|
|
|
(let ((new-spec `((t (:background ,(catppuccin-get-color 'surface1))))))
|
|
|
|
(dolist (f '(goggles-added
|
|
|
|
goggles-removed
|
|
|
|
goggles-changed))
|
|
|
|
(face-spec-set f new-spec))))
|
2023-01-23 21:28:42 -08:00
|
|
|
(setcar (cdr (assq 'goggles-mode minor-mode-alist)) " O-O"))
|
2023-01-08 22:56:09 -08:00
|
|
|
|
2023-07-20 23:27:00 -07:00
|
|
|
(defun my--set-tab-width-2 ()
|
|
|
|
(setq tab-width 2))
|
|
|
|
|
2022-12-23 14:50:06 -08:00
|
|
|
(use-package treesit
|
|
|
|
:ensure nil
|
2023-07-20 23:27:00 -07:00
|
|
|
:mode
|
|
|
|
("\\.ts\\'" . typescript-ts-mode)
|
|
|
|
("\\.tsx\\'" . tsx-ts-mode)
|
|
|
|
("\\.rs\\'" . rust-ts-mode)
|
2023-08-06 13:25:50 -07:00
|
|
|
("\\.ya?ml\\'" . yaml-ts-mode)
|
|
|
|
("/Dockerfile\\'" . dockerfile-ts-mode)
|
|
|
|
("\\(/CMakeLists.txt\\|\\.cmake\\)\\'" . cmake-ts-mode)
|
2023-07-20 23:27:00 -07:00
|
|
|
:hook
|
|
|
|
(typescript-ts-mode . my--set-tab-width-2)
|
|
|
|
(tsx-ts-mode . my--set-tab-width-2)
|
2023-01-06 09:47:59 -08:00
|
|
|
:init
|
|
|
|
(add-to-list 'major-mode-remap-alist '(sh-mode . bash-ts-mode))
|
|
|
|
(add-to-list 'major-mode-remap-alist '(css-mode . css-ts-mode))
|
|
|
|
(add-to-list 'major-mode-remap-alist '(c-mode . c-ts-mode))
|
|
|
|
(add-to-list 'major-mode-remap-alist '(c++-mode . c++-ts-mode))
|
|
|
|
(add-to-list 'major-mode-remap-alist '(csharp-mode . csharp-ts-mode))
|
|
|
|
(add-to-list 'major-mode-remap-alist '(java-mode . java-ts-mode))
|
|
|
|
(add-to-list 'major-mode-remap-alist '(python-mode . python-ts-mode))
|
|
|
|
(add-to-list 'major-mode-remap-alist '(ruby-mode . ruby-ts-mode))
|
2023-06-09 16:18:23 -07:00
|
|
|
(add-to-list 'major-mode-remap-alist '(html-mode . html-ts-mode))
|
2023-01-06 09:47:59 -08:00
|
|
|
(add-to-list 'major-mode-remap-alist '(js-mode . js-ts-mode))
|
|
|
|
(add-to-list 'major-mode-remap-alist '(js-json-mode . json-ts-mode))
|
2023-08-06 13:25:50 -07:00
|
|
|
(add-to-list 'major-mode-remap-alist '(conf-toml-mode . toml-ts-mode))
|
2023-06-09 16:18:23 -07:00
|
|
|
:config
|
|
|
|
(unless my-is-nixos
|
|
|
|
(add-to-list 'treesit-extra-load-path (expand-file-name "tree-sitter-module/dist/"
|
|
|
|
user-emacs-directory))))
|
2022-12-16 10:27:53 -08:00
|
|
|
|
|
|
|
(use-package dtrt-indent
|
2022-12-21 17:40:08 -08:00
|
|
|
:demand t
|
2022-12-16 10:27:53 -08:00
|
|
|
:config
|
2023-11-04 14:00:09 -07:00
|
|
|
(setcar (cdr (assq 'dtrt-indent-mode minor-mode-alist)) " dtrt")
|
|
|
|
(dtrt-indent-global-mode))
|
2022-12-16 10:27:53 -08:00
|
|
|
|
|
|
|
(use-package aggressive-indent
|
2023-01-23 21:28:42 -08:00
|
|
|
:custom
|
|
|
|
(aggressive-indent-sit-for-time 0.1)
|
2023-03-08 22:34:06 -08:00
|
|
|
:hook
|
|
|
|
emacs-lisp-mode
|
|
|
|
ielm-mode
|
|
|
|
lisp-mode
|
|
|
|
scheme-mode
|
|
|
|
clojure-mode
|
2023-11-04 00:01:00 -07:00
|
|
|
nix-mode)
|
2022-12-16 10:27:53 -08:00
|
|
|
|
|
|
|
(use-package rainbow-delimiters
|
2023-08-18 22:27:32 -07:00
|
|
|
:hook prog-mode sly-mrepl-mode racket-repl-mode)
|
2022-12-16 10:27:53 -08:00
|
|
|
|
2023-06-09 13:48:27 -07:00
|
|
|
(use-package highlight-indent-guides
|
2024-10-31 13:41:08 -07:00
|
|
|
:hook (prog-mode . my-maybe-highlight-indent-guides)
|
2023-06-09 13:48:27 -07:00
|
|
|
:custom
|
|
|
|
(highlight-indent-guides-auto-enabled nil)
|
|
|
|
(highlight-indent-guides-method 'character)
|
2024-10-31 13:41:08 -07:00
|
|
|
:config
|
|
|
|
(defun my-maybe-highlight-indent-guides ()
|
|
|
|
(interactive)
|
|
|
|
(unless (> (count-lines (point-min) (point-max)) 10000)
|
|
|
|
(highlight-indent-guides-mode))))
|
2023-06-09 13:48:27 -07:00
|
|
|
|
2022-12-16 10:27:53 -08:00
|
|
|
(use-package which-key
|
2022-12-21 17:40:08 -08:00
|
|
|
:demand t
|
2022-12-16 10:27:53 -08:00
|
|
|
:custom
|
|
|
|
(which-key-idle-delay 0.2)
|
|
|
|
:config
|
2023-11-04 00:01:00 -07:00
|
|
|
(with-eval-after-load 'god-mode
|
2023-11-04 14:00:09 -07:00
|
|
|
(which-key-enable-god-mode-support))
|
|
|
|
(which-key-mode))
|
2022-12-16 10:27:53 -08:00
|
|
|
|
2023-04-29 19:14:52 -07:00
|
|
|
(use-package flymake
|
|
|
|
:ensure nil
|
|
|
|
:bind (:map flymake-mode-map
|
|
|
|
("M-n" . flymake-goto-next-error)
|
|
|
|
("M-p" . flymake-goto-prev-error)))
|
|
|
|
|
2023-03-27 11:17:17 -07:00
|
|
|
(use-package eglot
|
2023-04-29 19:14:52 -07:00
|
|
|
:ensure nil
|
|
|
|
:bind (:map eglot-mode-map
|
|
|
|
("C-c e c" . eglot-code-actions)
|
|
|
|
("C-c e r" . eglot-rename)
|
|
|
|
("C-c e f" . eglot-format)
|
|
|
|
("C-c e s" . eglot-shutdown)
|
|
|
|
("C-c e S" . eglot-shutdown-all)
|
|
|
|
("C-c e R" . eglot-reconnect))
|
2023-03-08 22:34:06 -08:00
|
|
|
:hook
|
2023-03-27 11:17:17 -07:00
|
|
|
(c-mode . eglot-ensure)
|
|
|
|
(c-ts-mode . eglot-ensure)
|
|
|
|
(c++-mode . eglot-ensure)
|
|
|
|
(c++-ts-mode . eglot-ensure)
|
2024-01-25 23:10:25 -08:00
|
|
|
(haskell-mode . eglot-ensure)
|
2023-03-27 11:17:17 -07:00
|
|
|
(java-mode . eglot-ensure)
|
|
|
|
(java-ts-mode . eglot-ensure)
|
2023-07-20 23:27:00 -07:00
|
|
|
(js-mode . eglot-ensure)
|
|
|
|
(js-ts-mode . eglot-ensure)
|
2024-01-25 23:10:25 -08:00
|
|
|
(lua-mode . eglot-ensure)
|
|
|
|
(nix-mode . eglot-ensure)
|
2024-07-11 23:31:00 -07:00
|
|
|
(python-mode . eglot-ensure)
|
|
|
|
(python-ts-mode . eglot-ensure)
|
2024-01-25 23:10:25 -08:00
|
|
|
(rust-ts-mode . eglot-ensure)
|
2023-07-20 23:27:00 -07:00
|
|
|
(typescript-ts-mode . eglot-ensure)
|
|
|
|
(tsx-ts-mode . eglot-ensure)
|
2023-01-19 21:10:22 -08:00
|
|
|
:custom
|
2023-09-30 00:24:22 -07:00
|
|
|
(eglot-autoshutdown t)
|
|
|
|
:config
|
|
|
|
(setq-default eglot-workspace-configuration
|
|
|
|
'((haskell
|
|
|
|
(formattingProvider . "floskell")))))
|
2023-03-27 11:17:17 -07:00
|
|
|
|
2024-04-11 09:48:12 -07:00
|
|
|
(use-package eglot-booster
|
|
|
|
:ensure nil
|
|
|
|
:after eglot
|
|
|
|
:demand t
|
|
|
|
:custom
|
|
|
|
(eglot-booster-no-remote-boost t)
|
|
|
|
:config
|
|
|
|
(eglot-booster-mode))
|
|
|
|
|
2023-03-27 11:17:17 -07:00
|
|
|
(use-package eglot-java
|
|
|
|
:hook java-mode java-ts-mode)
|
2023-01-19 21:10:22 -08:00
|
|
|
|
2023-02-08 21:29:33 -08:00
|
|
|
(use-package yasnippet
|
|
|
|
:config
|
2023-02-09 11:24:03 -08:00
|
|
|
(advice-add #'yas-expand-snippet
|
|
|
|
:around
|
|
|
|
(lambda (oldfun &rest r)
|
|
|
|
(let ((org-src-tab-acts-natively nil))
|
|
|
|
(apply oldfun r)))
|
2023-06-08 18:22:30 -07:00
|
|
|
'((name . my--yas-expand-disable-org-tab-native)))
|
|
|
|
(yas-global-mode))
|
2023-02-08 21:29:33 -08:00
|
|
|
|
|
|
|
(use-package yasnippet-snippets)
|
|
|
|
|
2023-01-24 23:31:15 -08:00
|
|
|
(use-package consult
|
2023-03-08 22:34:06 -08:00
|
|
|
:bind
|
|
|
|
("M-s r" . consult-ripgrep)
|
|
|
|
("M-s d" . consult-find)
|
|
|
|
("C-x M-:" . consult-complex-command)
|
|
|
|
("C-x b" . consult-buffer)
|
|
|
|
("C-x r b" . consult-bookmark))
|
2023-01-19 21:10:22 -08:00
|
|
|
|
2023-02-08 21:29:33 -08:00
|
|
|
(use-package consult-yasnippet
|
2023-03-08 22:34:06 -08:00
|
|
|
:bind
|
|
|
|
("C-c s" . consult-yasnippet)
|
|
|
|
("C-c S" . consult-yasnippet-visit-snippet-file))
|
2023-02-08 21:29:33 -08:00
|
|
|
|
2023-02-08 08:42:44 -08:00
|
|
|
(use-package embark
|
2023-03-08 22:34:06 -08:00
|
|
|
:bind
|
|
|
|
("C-." . embark-act)
|
|
|
|
("C-;" . embark-dwim))
|
2023-02-08 08:42:44 -08:00
|
|
|
|
|
|
|
(use-package embark-consult)
|
|
|
|
|
2022-12-16 10:27:53 -08:00
|
|
|
(use-package orderless
|
2022-12-21 17:40:08 -08:00
|
|
|
:demand t
|
2022-12-16 10:27:53 -08:00
|
|
|
:custom
|
|
|
|
(completion-styles '(orderless basic))
|
|
|
|
(completion-category-defaults nil)
|
2023-04-17 13:52:30 -07:00
|
|
|
(completion-category-overrides '((file (styles basic partial-completion)))))
|
2022-12-16 10:27:53 -08:00
|
|
|
|
|
|
|
(use-package marginalia
|
2024-04-11 09:48:12 -07:00
|
|
|
:demand t
|
2023-01-19 21:10:22 -08:00
|
|
|
:bind (:map minibuffer-local-map ("M-a" . marginalia-cycle))
|
2022-12-21 17:40:08 -08:00
|
|
|
:config
|
2022-12-16 10:27:53 -08:00
|
|
|
(marginalia-mode))
|
|
|
|
|
|
|
|
(use-package vertico
|
2022-12-21 17:40:08 -08:00
|
|
|
:demand t
|
2022-12-16 10:27:53 -08:00
|
|
|
:config
|
|
|
|
(vertico-mode)
|
|
|
|
(vertico-mouse-mode))
|
|
|
|
|
2023-01-19 21:10:22 -08:00
|
|
|
(use-package corfu
|
|
|
|
:demand t
|
|
|
|
:custom
|
|
|
|
(corfu-auto t)
|
2023-01-24 23:31:15 -08:00
|
|
|
(corfu-cycle t)
|
|
|
|
(corfu-preselect-first nil)
|
|
|
|
(corfu-scroll-margin 3)
|
|
|
|
(tab-always-indent 'complete)
|
2023-01-19 21:10:22 -08:00
|
|
|
:config
|
2023-03-29 10:29:50 -07:00
|
|
|
(add-hook 'minibuffer-setup-hook
|
|
|
|
(lambda ()
|
|
|
|
(when (where-is-internal #'completion-at-point
|
|
|
|
(list (current-local-map)))
|
|
|
|
(setq-local corfu-echo-display nil
|
|
|
|
corfu-popupinfo-delay nil)
|
2023-11-04 14:00:09 -07:00
|
|
|
(corfu-mode))))
|
|
|
|
(global-corfu-mode))
|
2023-01-19 21:10:22 -08:00
|
|
|
|
2023-02-08 08:42:44 -08:00
|
|
|
(use-package cape)
|
|
|
|
|
2024-10-10 23:14:03 -07:00
|
|
|
(use-package all-the-icons)
|
2022-12-16 10:27:53 -08:00
|
|
|
(use-package all-the-icons-completion
|
2024-10-10 23:14:03 -07:00
|
|
|
:demand t
|
2022-12-16 10:27:53 -08:00
|
|
|
:hook (marginalia-mode . all-the-icons-completion-marginalia-setup)
|
2024-10-10 23:14:03 -07:00
|
|
|
:config
|
|
|
|
(require 'marginalia)
|
|
|
|
;; NOTE: https://github.com/iyefrat/all-the-icons-completion/pull/33
|
|
|
|
(add-hook 'all-the-icons-completion-mode-hook
|
|
|
|
(lambda ()
|
|
|
|
(if all-the-icons-completion-mode
|
|
|
|
(advice-add (compat-function completion-metadata-get)
|
|
|
|
:around
|
|
|
|
#'all-the-icons-completion-completion-metadata-get)
|
|
|
|
(advice-remove (compat-function completion-metadata-get)
|
|
|
|
#'all-the-icons-completion-completion-metadata-get))))
|
2022-12-16 10:27:53 -08:00
|
|
|
(all-the-icons-completion-mode))
|
|
|
|
|
2023-01-23 21:28:42 -08:00
|
|
|
(use-package treemacs)
|
2022-12-16 10:27:53 -08:00
|
|
|
(use-package treemacs-all-the-icons
|
2022-12-21 17:40:08 -08:00
|
|
|
:after treemacs
|
2024-04-11 09:48:12 -07:00
|
|
|
:demand t
|
2022-12-16 10:27:53 -08:00
|
|
|
:config
|
|
|
|
(treemacs-load-theme 'all-the-icons))
|
|
|
|
|
|
|
|
(use-package doom-modeline
|
2022-12-21 17:40:08 -08:00
|
|
|
:demand t
|
2023-04-01 23:23:40 -07:00
|
|
|
:custom
|
|
|
|
(doom-modeline-continuous-word-count-modes '(markdown-mode gfm-mode org-mode))
|
2023-12-05 02:22:37 -08:00
|
|
|
(doom-modeline-enable-word-count t)
|
2023-04-01 23:23:40 -07:00
|
|
|
(doom-modeline-indent-info t)
|
|
|
|
(doom-modeline-minor-modes t)
|
|
|
|
(doom-modeline-battery nil)
|
2022-12-16 10:27:53 -08:00
|
|
|
:config
|
|
|
|
(doom-modeline-mode))
|
|
|
|
|
2023-04-01 23:23:40 -07:00
|
|
|
(use-package minions
|
|
|
|
:demand t
|
|
|
|
:config
|
|
|
|
(minions-mode))
|
|
|
|
|
2022-12-16 10:27:53 -08:00
|
|
|
(use-package dirvish
|
|
|
|
:after dired
|
2024-04-11 09:48:12 -07:00
|
|
|
:demand t
|
2022-12-16 10:27:53 -08:00
|
|
|
:custom
|
2023-08-30 23:50:45 -07:00
|
|
|
(dired-auto-revert-buffer t)
|
2022-12-16 10:27:53 -08:00
|
|
|
(dirvish-attributes '(all-the-icons))
|
|
|
|
:config
|
|
|
|
(dirvish-override-dired-mode))
|
|
|
|
|
2023-11-04 14:02:42 -07:00
|
|
|
(use-package persp-mode
|
|
|
|
:if nil
|
|
|
|
:bind ("C-c p" . persp-key-map)
|
|
|
|
:custom
|
|
|
|
(persp-keymap-prefix nil)
|
|
|
|
:init
|
|
|
|
(when (daemonp)
|
|
|
|
(require 'persp-mode))
|
|
|
|
:config
|
|
|
|
(with-eval-after-load 'consult
|
|
|
|
(consult-customize consult--source-buffer :hidden t :default nil)
|
|
|
|
(add-to-list 'consult-buffer-sources
|
|
|
|
(list :name "Perspective"
|
|
|
|
:narrow ?s
|
|
|
|
:category 'buffer
|
|
|
|
:state #'consult--buffer-state
|
|
|
|
:history 'buffer-name-history
|
|
|
|
:default t
|
|
|
|
:items (lambda ()
|
|
|
|
(consult--buffer-query :sort 'visibility
|
|
|
|
:predicate (lambda (buf)
|
|
|
|
(memq buf (persp-buffer-list)))
|
|
|
|
:as #'buffer-name)))))
|
|
|
|
(persp-mode))
|
|
|
|
|
2023-04-09 14:27:14 -07:00
|
|
|
(use-package alert
|
|
|
|
:ensure nil
|
|
|
|
:custom
|
|
|
|
(alert-default-style 'libnotify)
|
|
|
|
(alert-libnotify-command (expand-file-name "scripts/emacs-hyprland-notify"
|
|
|
|
user-emacs-directory)))
|
|
|
|
|
2022-12-16 10:27:53 -08:00
|
|
|
(use-package pdf-tools
|
2023-01-06 09:47:59 -08:00
|
|
|
:mode ("\\.pdf\\'" . pdf-view-mode)
|
2023-03-08 10:04:19 -08:00
|
|
|
:bind (:map pdf-view-mode-map ("/" . #'isearch-forward))
|
2022-12-16 10:27:53 -08:00
|
|
|
:config
|
|
|
|
(pdf-tools-install))
|
|
|
|
|
2023-08-30 23:50:45 -07:00
|
|
|
(defun my-double-space-sentence ()
|
|
|
|
(setq-local sentence-end-double-space t))
|
|
|
|
|
2023-07-06 11:39:17 -07:00
|
|
|
(use-package engrave-faces)
|
|
|
|
|
2022-12-16 10:27:53 -08:00
|
|
|
(use-package org
|
2023-03-08 22:34:06 -08:00
|
|
|
:hook
|
|
|
|
(org-mode . auto-fill-mode)
|
2023-05-06 13:29:19 -07:00
|
|
|
(org-mode . my-inhibit-hl-line-mode)
|
2023-08-30 23:50:45 -07:00
|
|
|
(org-mode . my-double-space-sentence)
|
2022-12-16 10:27:53 -08:00
|
|
|
:custom
|
2023-07-20 23:27:00 -07:00
|
|
|
(org-startup-with-inline-images t)
|
2023-03-22 21:26:10 -07:00
|
|
|
(org-special-ctrl-a/e t)
|
|
|
|
(org-insert-heading-respect-content t)
|
2022-12-16 10:27:53 -08:00
|
|
|
(org-list-allow-alphabetical t)
|
2022-12-23 16:32:34 -08:00
|
|
|
(org-hide-emphasis-markers t)
|
2023-01-01 00:38:59 -08:00
|
|
|
(org-pretty-entities t)
|
2023-02-10 13:39:46 -08:00
|
|
|
(org-babel-load-languages '((emacs-lisp . t)
|
|
|
|
(ruby . t)
|
|
|
|
(python . t)
|
|
|
|
(shell . t)
|
|
|
|
(C . t)))
|
2023-05-03 18:17:26 -07:00
|
|
|
(org-agenda-files '("~/Agenda"))
|
2023-02-27 20:30:43 -08:00
|
|
|
;; NixOS minimal LaTeX setup
|
|
|
|
(org-latex-compiler "lualatex")
|
|
|
|
(org-preview-latex-default-process 'dvisvgm)
|
2023-07-06 11:39:17 -07:00
|
|
|
(org-latex-src-block-backend 'engraved)
|
2022-12-16 10:27:53 -08:00
|
|
|
:config
|
2023-05-03 18:17:26 -07:00
|
|
|
(setq org-format-latex-options (plist-put org-format-latex-options :scale 1.1)
|
|
|
|
org-modules (append '(org-tempo org-habit) org-modules))
|
2023-03-27 11:17:17 -07:00
|
|
|
(with-eval-after-load 'catppuccin-theme
|
|
|
|
(face-spec-set 'org-block `((t (:foreground ,(catppuccin-get-color 'text)))))))
|
2022-12-16 10:27:53 -08:00
|
|
|
|
2023-05-03 18:17:26 -07:00
|
|
|
(use-package org-alert
|
|
|
|
:init
|
|
|
|
(when (daemonp)
|
|
|
|
(run-with-idle-timer 10 nil #'require 'org-alert))
|
|
|
|
:config
|
|
|
|
(setq org-alert-notification-title "org-alert"
|
|
|
|
org-alert-notify-cutoff 30)
|
|
|
|
(org-alert-enable))
|
|
|
|
|
2023-03-22 21:26:10 -07:00
|
|
|
(use-package org-modern
|
|
|
|
:hook
|
|
|
|
org-mode
|
2023-05-03 18:17:26 -07:00
|
|
|
(org-agenda-finalize . org-modern-agenda)
|
|
|
|
:config
|
|
|
|
(with-eval-after-load 'catppuccin-theme
|
|
|
|
(face-spec-set 'org-modern-done `((t (:foreground
|
|
|
|
,(catppuccin-get-color 'text)
|
|
|
|
:background
|
|
|
|
,(catppuccin-get-color 'surface0)))))
|
|
|
|
(face-spec-set 'org-modern-date-inactive `((t (:foreground
|
|
|
|
,(catppuccin-get-color 'subtext0)
|
|
|
|
:background
|
|
|
|
,(catppuccin-get-color 'surface0)))))
|
|
|
|
(face-spec-set 'org-modern-horizontal-rule `((t (:strike-through
|
|
|
|
,(catppuccin-get-color 'overlay1)))))
|
|
|
|
(face-spec-set 'org-modern-tag `((t (:foreground
|
|
|
|
,(catppuccin-get-color 'base)
|
|
|
|
:background
|
|
|
|
,(catppuccin-get-color 'sapphire)))))
|
|
|
|
(face-spec-set 'org-modern-time-active `((t (:foreground
|
|
|
|
,(catppuccin-get-color 'base)
|
|
|
|
:background
|
|
|
|
,(catppuccin-get-color 'overlay2)))))
|
|
|
|
(face-spec-set 'org-modern-time-inactive `((t (:foreground
|
|
|
|
,(catppuccin-get-color 'base)
|
|
|
|
:background
|
|
|
|
,(catppuccin-get-color 'surface0)))))))
|
2023-03-22 21:26:10 -07:00
|
|
|
|
|
|
|
(use-package org-modern-indent
|
|
|
|
:ensure nil
|
|
|
|
:hook org-modern-mode)
|
2022-12-16 10:27:53 -08:00
|
|
|
|
2023-07-06 11:39:17 -07:00
|
|
|
(use-package djvu)
|
2023-11-15 21:39:01 -08:00
|
|
|
|
|
|
|
(use-package nov
|
|
|
|
:mode ("\\.epub\\'" . nov-mode))
|
2023-07-06 11:39:17 -07:00
|
|
|
|
2022-12-16 10:27:53 -08:00
|
|
|
(use-package org-pdftools
|
|
|
|
:hook (org-mode . org-pdftools-setup-link))
|
|
|
|
|
|
|
|
(use-package editorconfig
|
2022-12-21 17:40:08 -08:00
|
|
|
:demand t
|
2022-12-16 10:27:53 -08:00
|
|
|
:config
|
2023-01-23 21:28:42 -08:00
|
|
|
(editorconfig-mode)
|
|
|
|
(setcar (cdr (assq 'editorconfig-mode minor-mode-alist)) " EdConf"))
|
2022-12-16 10:27:53 -08:00
|
|
|
|
2023-02-18 23:42:10 -08:00
|
|
|
(use-package envrc
|
|
|
|
:bind ("C-c v" . envrc-command-map)
|
|
|
|
:hook (after-init . envrc-global-mode))
|
|
|
|
|
2023-08-18 22:27:32 -07:00
|
|
|
(use-package sly
|
2023-02-27 20:08:32 -08:00
|
|
|
:custom
|
2023-08-18 22:27:32 -07:00
|
|
|
(sly-symbol-completion-mode nil)
|
2023-02-27 20:08:32 -08:00
|
|
|
:config
|
2023-04-18 22:08:44 -07:00
|
|
|
(setq inferior-lisp-program "sbcl")
|
2023-08-20 12:15:30 -07:00
|
|
|
(defun my--sly-add-project-root-to-asdf (old-init)
|
|
|
|
(let ((dir (if-let* ((proj (project-current))
|
|
|
|
(root (project-root proj)))
|
|
|
|
root
|
|
|
|
default-directory)))
|
|
|
|
(if (directory-files dir nil "\\.asd\\'" t 1)
|
|
|
|
(let ((old-init-list (read old-init)))
|
|
|
|
(setf (cddadr old-init-list)
|
|
|
|
(cons `(push (pathname ,(sly-to-lisp-filename dir))
|
|
|
|
(symbol-value
|
|
|
|
(read-from-string "asdf:*central-registry*")))
|
|
|
|
(cddadr old-init-list)))
|
|
|
|
(format "%S\n\n" old-init-list))
|
|
|
|
old-init)))
|
|
|
|
(advice-add #'sly-init-using-asdf :filter-return #'my--sly-add-project-root-to-asdf)
|
2023-09-30 00:24:31 -07:00
|
|
|
(sly-setup))
|
2023-08-18 22:27:32 -07:00
|
|
|
|
|
|
|
(use-package sly-asdf)
|
|
|
|
(use-package sly-named-readtables)
|
2023-02-27 20:08:32 -08:00
|
|
|
|
2023-07-23 15:36:23 -07:00
|
|
|
(use-package racket-mode
|
|
|
|
:hook (racket-mode . racket-xp-mode))
|
|
|
|
|
2023-09-30 00:24:22 -07:00
|
|
|
(use-package haskell-mode
|
2024-01-14 22:22:41 -08:00
|
|
|
:hook (haskell-mode . interactive-haskell-mode)
|
2023-09-30 00:24:22 -07:00
|
|
|
:custom
|
|
|
|
(haskell-process-show-debug-tips nil))
|
|
|
|
|
2023-04-18 21:54:48 -07:00
|
|
|
(use-package lua-mode
|
|
|
|
:custom
|
|
|
|
(lua-indent-level 4)
|
|
|
|
(lua-indent-nested-block-content-align nil)
|
|
|
|
(lua-indent-close-paren-align nil))
|
|
|
|
|
2023-02-09 11:24:03 -08:00
|
|
|
(use-package nix-mode)
|
2022-12-29 22:17:36 -08:00
|
|
|
|
2022-12-23 16:32:34 -08:00
|
|
|
(use-package markdown-mode
|
|
|
|
:mode ("README\\.md\\'" . gfm-mode)
|
|
|
|
:custom
|
|
|
|
(markdown-command '("pandoc" "--from=markdown" "--to=html5")))
|
|
|
|
|
2023-07-20 23:27:00 -07:00
|
|
|
(use-package csv-mode)
|
|
|
|
|
2023-02-09 11:24:03 -08:00
|
|
|
(use-package meson-mode)
|
2023-01-16 21:28:47 -08:00
|
|
|
|
2024-01-14 22:22:01 -08:00
|
|
|
(use-package jinx
|
|
|
|
:hook text-mode)
|
2023-03-08 10:04:19 -08:00
|
|
|
|
2022-12-16 10:27:53 -08:00
|
|
|
(use-package minimap
|
|
|
|
:custom-face
|
2023-02-10 16:43:24 -08:00
|
|
|
(minimap-active-region-background ((t (:background unspecified :inherit hl-line))))
|
2023-01-08 20:48:37 -08:00
|
|
|
:hook (minimap-sb-mode . turn-on-solaire-mode))
|
2022-12-16 10:27:53 -08:00
|
|
|
|
2022-12-21 23:39:38 -08:00
|
|
|
(use-package magit
|
2024-01-14 22:22:01 -08:00
|
|
|
:hook (git-commit-setup . git-commit-turn-on-auto-fill))
|
2022-12-16 10:27:53 -08:00
|
|
|
|
2023-03-08 22:34:06 -08:00
|
|
|
(use-package forge
|
|
|
|
:after magit
|
|
|
|
:demand t)
|
|
|
|
|
2022-12-16 10:27:53 -08:00
|
|
|
(use-package tramp
|
|
|
|
:custom
|
|
|
|
(remote-file-name-inhibit-cache nil)
|
|
|
|
(tramp-verbose 1)
|
|
|
|
:config
|
|
|
|
(setq vc-ignore-dir-regexp (format "%s\\|%s"
|
|
|
|
vc-ignore-dir-regexp
|
|
|
|
tramp-file-name-regexp)))
|
|
|
|
|
2023-11-04 00:01:00 -07:00
|
|
|
(use-package eat
|
2023-03-08 22:34:06 -08:00
|
|
|
:bind
|
2023-11-04 00:01:00 -07:00
|
|
|
("C-c t" . eat)
|
|
|
|
(:map eat-mode-map
|
|
|
|
("<escape>" . eat-self-input))
|
2023-11-09 10:10:13 -08:00
|
|
|
:hook (eat-mode . my-inhibit-hl-line-mode)
|
2022-12-24 15:52:45 -08:00
|
|
|
:config
|
2023-11-04 00:01:00 -07:00
|
|
|
(with-eval-after-load 'god-mode
|
2023-11-04 12:46:20 -07:00
|
|
|
(add-to-list 'god-exempt-major-modes 'eat-mode)))
|
2022-12-23 22:04:26 -08:00
|
|
|
|
2023-03-29 10:29:50 -07:00
|
|
|
(use-package circe
|
|
|
|
:hook (circe-channel-mode . enable-lui-autopaste)
|
|
|
|
:custom
|
|
|
|
(circe-default-nick "eriedaberrie")
|
|
|
|
(circe-default-user "eriedaberrie")
|
|
|
|
(circe-default-realname "eriedaberrie")
|
|
|
|
(circe-format-self-say ">>> {body}")
|
|
|
|
(lui-time-stamp-position 'right-margin)
|
|
|
|
(lui-fill-type nil)
|
2023-06-09 14:06:31 -07:00
|
|
|
(lui-time-stamp-format "%T")
|
2023-03-29 10:29:50 -07:00
|
|
|
:config
|
|
|
|
(--when-let (nth 0 (auth-source-search :max 1
|
|
|
|
:require '(:user :secret)
|
|
|
|
:host "irc.libera.chat"
|
|
|
|
:port 6697))
|
|
|
|
(let ((user (plist-get it :user))
|
|
|
|
(secret (plist-get it :secret)))
|
|
|
|
(setq circe-network-options
|
|
|
|
`(("Libera Chat"
|
|
|
|
:tls t
|
|
|
|
:nick ,user
|
|
|
|
:sasl-username ,user
|
|
|
|
:sasl-password ,(if (functionp secret)
|
|
|
|
(funcall secret)
|
|
|
|
secret)
|
2024-01-25 23:10:51 -08:00
|
|
|
:channels ("#emacs" "#nixos" "#lisp" "#commonlisp"))))))
|
2023-03-29 10:29:50 -07:00
|
|
|
(add-hook 'lui-mode-hook
|
|
|
|
(lambda ()
|
|
|
|
(visual-line-mode)
|
|
|
|
(setq-local fringes-outside-margins t
|
2023-06-09 14:06:31 -07:00
|
|
|
right-margin-width 8
|
2023-03-29 10:29:50 -07:00
|
|
|
wrap-prefix " ")
|
|
|
|
(setcdr (assoc 'continuation fringe-indicator-alist) nil))))
|
|
|
|
|
2023-04-01 23:21:36 -07:00
|
|
|
(use-package circe-notifications
|
|
|
|
:hook (circe-server-connected . enable-circe-notifications))
|
|
|
|
|
2023-06-09 14:06:31 -07:00
|
|
|
(use-package mpv)
|
2023-08-06 13:28:34 -07:00
|
|
|
(use-package lingva
|
|
|
|
:custom
|
|
|
|
(lingva-instance "lingva.garudalinux.org"))
|
2023-06-09 14:06:31 -07:00
|
|
|
|
|
|
|
(use-package mastodon
|
|
|
|
:custom
|
|
|
|
(mastodon-instance-url "https://fosstodon.org")
|
|
|
|
(mastodon-active-user "eriedaberrie")
|
|
|
|
(mastodon-toot-timestamp-format "%F %-I:%M %p"))
|
|
|
|
|
2022-12-16 10:27:53 -08:00
|
|
|
(use-package elfeed
|
|
|
|
:custom
|
2023-09-01 21:30:15 -07:00
|
|
|
(elfeed-feeds '(("https://archlinux.org/feeds/news/" arch-linux)
|
|
|
|
("https://nixos.org/blog/announcements-rss.xml" nixos))))
|
2022-12-16 10:27:53 -08:00
|
|
|
|
2023-03-08 10:04:19 -08:00
|
|
|
(use-package xkcd)
|
2022-12-16 10:27:53 -08:00
|
|
|
|
2023-03-10 23:35:34 -08:00
|
|
|
(use-package page-break-lines
|
|
|
|
:hook
|
|
|
|
emacs-lisp-mode
|
|
|
|
lisp-mode
|
|
|
|
scheme-mode
|
|
|
|
compilation-mode
|
|
|
|
outline-mode
|
|
|
|
help-mode)
|
|
|
|
|
2023-03-08 22:34:06 -08:00
|
|
|
(use-package hl-todo
|
|
|
|
:hook prog-mode)
|
|
|
|
|
2022-12-21 17:40:08 -08:00
|
|
|
(use-package gruvbox-theme)
|
2023-01-08 20:48:37 -08:00
|
|
|
(use-package catppuccin-theme
|
2023-01-21 17:31:58 -08:00
|
|
|
:demand t
|
2023-01-27 11:00:39 -08:00
|
|
|
:custom-face
|
2024-09-27 11:44:08 -07:00
|
|
|
(line-number-current-line ((t (:inherit (hl-line default)))))
|
2023-01-12 21:00:23 -08:00
|
|
|
:custom
|
2023-04-01 23:23:40 -07:00
|
|
|
(catppuccin-flavor 'mocha)
|
2023-05-06 13:29:19 -07:00
|
|
|
(catppuccin-highlight-matches t)
|
|
|
|
(catppuccin-italic-comments t)
|
2023-07-06 11:39:17 -07:00
|
|
|
(catppuccin-italic-blockquotes t)
|
2023-05-06 13:29:19 -07:00
|
|
|
(catppuccin-italic-variables t))
|
2023-01-08 20:48:37 -08:00
|
|
|
|
2023-02-18 22:07:57 -08:00
|
|
|
(defun my-load-theme-with-solaire ()
|
2023-01-12 21:00:23 -08:00
|
|
|
(load-theme 'catppuccin t)
|
|
|
|
(catppuccin-reload)
|
2023-03-08 22:34:06 -08:00
|
|
|
(face-spec-set 'font-lock-variable-name-face `((t (:foreground
|
|
|
|
,(catppuccin-get-color 'flamingo)))))
|
2022-12-16 10:27:53 -08:00
|
|
|
(solaire-global-mode)
|
|
|
|
(when (daemonp)
|
2023-02-18 22:07:57 -08:00
|
|
|
(remove-hook 'server-after-make-frame-hook #'my-load-theme-with-solaire)))
|
2022-12-16 10:27:53 -08:00
|
|
|
|
|
|
|
(use-package solaire-mode
|
2022-12-21 17:40:08 -08:00
|
|
|
:demand t
|
2022-12-16 10:27:53 -08:00
|
|
|
:custom
|
|
|
|
(solaire-mode-real-buffer-fn (lambda ()
|
|
|
|
(and (solaire-mode-real-buffer-p)
|
|
|
|
(or (custom-theme-enabled-p 'gruvbox)
|
2023-02-18 22:07:57 -08:00
|
|
|
(not (memq 'minimap-sb-mode
|
|
|
|
local-minor-modes))))))
|
2022-12-16 10:27:53 -08:00
|
|
|
:config
|
|
|
|
(if (daemonp)
|
2023-02-18 22:07:57 -08:00
|
|
|
(add-hook 'server-after-make-frame-hook #'my-load-theme-with-solaire)
|
|
|
|
(my-load-theme-with-solaire)))
|
2022-12-16 10:27:53 -08:00
|
|
|
|
2023-03-08 22:34:06 -08:00
|
|
|
(use-package with-editor
|
|
|
|
:bind
|
|
|
|
([remap async-shell-command] . with-editor-async-shell-command)
|
|
|
|
([remap shell-command] . with-editor-shell-command)
|
|
|
|
:hook
|
|
|
|
(shell-mode . with-editor-export-editor)
|
|
|
|
(eshell-mode . with-editor-export-editor)
|
2023-11-04 00:01:00 -07:00
|
|
|
(term-exec . with-editor-export-editor))
|
2023-03-08 22:34:06 -08:00
|
|
|
|
2023-03-30 23:04:35 -07:00
|
|
|
(use-package nyan-mode
|
|
|
|
:custom
|
|
|
|
(nyan-animate-nyancat t)
|
|
|
|
(nyan-wavy-trail t))
|
|
|
|
|
2023-03-14 21:26:01 -07:00
|
|
|
(use-package smtpmail
|
|
|
|
:ensure nil
|
|
|
|
:custom
|
|
|
|
(smtpmail-smtp-service 587)
|
|
|
|
(smtpmail-stream-type 'starttls)
|
|
|
|
(smtpmail-default-smtp-server "smtp.gmail.com")
|
|
|
|
(message-send-mail-function #'smtpmail-send-it)
|
|
|
|
(message-citation-line-function #'message-insert-formatted-citation-line)
|
|
|
|
(message-kill-buffer-on-exit t))
|
|
|
|
|
|
|
|
(use-package mu4e
|
|
|
|
:if my-is-nixos
|
|
|
|
:ensure nil
|
|
|
|
:bind
|
2023-11-04 16:29:34 -07:00
|
|
|
("C-c m m" . mu4e)
|
|
|
|
("C-c m c" . mu4e-compose-new)
|
|
|
|
("C-c m u" . mu4e-update-mail-and-index)
|
2023-06-08 18:22:30 -07:00
|
|
|
:hook
|
|
|
|
(mu4e-view-mode . my-inhibit-hl-line-mode)
|
|
|
|
(message-mode . my-double-space-sentence)
|
2023-03-14 21:26:01 -07:00
|
|
|
:custom
|
|
|
|
(mail-user-agent 'mu4e-user-agent)
|
|
|
|
(mu4e-get-mail-command "mbsync -a")
|
|
|
|
(mu4e-sent-messages-behavior 'delete)
|
|
|
|
(mu4e-change-filenames-when-moving t)
|
|
|
|
(mu4e-view-show-images t)
|
|
|
|
(mu4e-use-fancy-chars t)
|
|
|
|
(mu4e-attachment-dir "~/Downloads")
|
|
|
|
(mu4e-context-policy 'ask)
|
|
|
|
(mu4e-compose-context-policy 'ask-if-none)
|
|
|
|
(mu4e-confirm-quit nil)
|
|
|
|
(mu4e-completing-read-function #'completing-read)
|
|
|
|
:init
|
|
|
|
(let ((age-file "/run/agenix/email.json"))
|
|
|
|
(when (file-exists-p age-file)
|
|
|
|
(defvar my--agenix-email-json-data
|
|
|
|
(with-temp-buffer
|
|
|
|
(insert-file-contents age-file)
|
|
|
|
(json-parse-buffer :object-type 'alist)))
|
|
|
|
(pcase-let ((`((address . ,address) (name . ,name) ,_)
|
|
|
|
(alist-get 'personal my--agenix-email-json-data)))
|
|
|
|
(setq user-mail-address address
|
|
|
|
user-full-name name))))
|
|
|
|
:config
|
|
|
|
(when (boundp 'my--agenix-email-json-data)
|
|
|
|
(setq mu4e-contexts
|
|
|
|
(--map (pcase-let ((`(,type (address . ,address) (name . ,name) ,_) it))
|
|
|
|
(make-mu4e-context
|
|
|
|
:name (symbol-name type)
|
|
|
|
:enter-func (lambda ()
|
|
|
|
(mu4e-message (format "Entering \"%s\" context"
|
|
|
|
type)))
|
|
|
|
:leave-func (lambda ()
|
|
|
|
(mu4e-message (format "Leaving \"%s\" context"
|
|
|
|
type)))
|
|
|
|
:match-func (lambda (msg)
|
|
|
|
(when msg
|
|
|
|
(mu4e-message-contact-field-matches
|
|
|
|
msg
|
|
|
|
:to address)))
|
|
|
|
:vars (cl-labels ((folder-name (folder-type)
|
|
|
|
(format "/%s/[Gmail]/%s" type folder-type)))
|
|
|
|
`((user-mail-address . ,address)
|
|
|
|
(user-full-name . ,name)
|
|
|
|
(mu4e-drafts-folder . ,(folder-name "Drafts"))
|
|
|
|
(mu4e-sent-folder . ,(folder-name "Sent Mail"))
|
|
|
|
(mu4e-trash-folder . ,(folder-name "Trash"))
|
|
|
|
(smtpmail-smtp-server . "smtp.gmail.com")
|
|
|
|
(smtpmail-smtp-user . ,address)))))
|
|
|
|
my--agenix-email-json-data)))
|
|
|
|
(when (fboundp 'imagemagick-register-types)
|
2023-11-04 00:01:00 -07:00
|
|
|
(imagemagick-register-types)))
|
2023-03-14 21:26:01 -07:00
|
|
|
|
2023-07-20 23:27:00 -07:00
|
|
|
(use-package org-msg
|
|
|
|
:after message
|
|
|
|
:demand t
|
|
|
|
:custom
|
|
|
|
(org-msg-convert-citation t)
|
|
|
|
(org-msg-greeting-fmt "\nHi%s,\n\n"))
|
|
|
|
|
2022-12-16 10:27:53 -08:00
|
|
|
(use-package emacs-everywhere
|
2023-02-22 22:28:26 -08:00
|
|
|
:custom
|
2024-04-30 23:09:38 -07:00
|
|
|
(emacs-everywhere-app-info-function
|
|
|
|
(lambda ()
|
|
|
|
(let* ((string-data (emacs-everywhere-call "hyprctl" "-j" "activewindow"))
|
|
|
|
(window-data (json-parse-string string-data
|
|
|
|
:object-type 'plist
|
|
|
|
:array-type 'list
|
|
|
|
:null-object nil
|
|
|
|
:false-object nil))
|
|
|
|
(window-id (plist-get window-data :address))
|
|
|
|
(app-id (plist-get window-data :class))
|
|
|
|
(window-title (plist-get window-data :title))
|
|
|
|
(window-geometry (append (plist-get window-data :at)
|
|
|
|
(plist-get window-data :size))))
|
|
|
|
(make-emacs-everywhere-app
|
|
|
|
:id window-id
|
|
|
|
:class app-id
|
|
|
|
:title window-title
|
|
|
|
:geometry window-geometry))))
|
|
|
|
(emacs-everywhere-window-focus-command '("hyprctl" "dispatch" "focuswindow" "address:%w"))
|
|
|
|
:config
|
|
|
|
(dolist (f '((alpha-background . 1.0) (width . 120) (height . 20)))
|
|
|
|
(add-to-list 'emacs-everywhere-frame-parameters f)))
|
2022-12-16 10:27:53 -08:00
|
|
|
|
2023-06-08 18:22:30 -07:00
|
|
|
(use-package prettify-symbols
|
|
|
|
:ensure nil
|
|
|
|
:hook prog-mode org-mode
|
|
|
|
:custom
|
|
|
|
(prettify-symbols-unprettify-at-point t))
|
|
|
|
|
2023-07-23 15:36:23 -07:00
|
|
|
(use-package electric-pair-mode
|
|
|
|
:ensure nil
|
|
|
|
:hook
|
|
|
|
(prog-mode . electric-pair-local-mode)
|
2023-08-06 13:25:50 -07:00
|
|
|
(eval-expression-minibuffer-setup . electric-pair-local-mode)
|
2023-08-18 22:27:32 -07:00
|
|
|
(sly-mrepl-mode . electric-pair-local-mode)
|
2023-07-23 15:36:23 -07:00
|
|
|
(racket-repl-mode . electric-pair-local-mode))
|
|
|
|
|
2023-01-12 21:00:23 -08:00
|
|
|
(use-package ffap
|
2023-02-16 12:27:06 -08:00
|
|
|
:ensure nil
|
2023-01-12 21:00:23 -08:00
|
|
|
:demand t
|
|
|
|
:config
|
|
|
|
(ffap-bindings))
|
|
|
|
|
2023-02-16 12:27:06 -08:00
|
|
|
(use-package eldoc
|
|
|
|
:ensure nil
|
|
|
|
:custom
|
|
|
|
(eldoc-documentation-strategy #'eldoc-documentation-compose-eagerly))
|
|
|
|
|
2023-02-08 08:42:44 -08:00
|
|
|
(use-package ibuffer
|
2023-05-13 13:31:18 -07:00
|
|
|
:ensure nil
|
2023-02-08 08:42:44 -08:00
|
|
|
:bind ("C-x C-b" . ibuffer))
|
|
|
|
|
2023-08-30 23:50:45 -07:00
|
|
|
(use-package info
|
|
|
|
:ensure nil
|
|
|
|
:hook (Info-mode . my-inhibit-hl-line-mode))
|
|
|
|
|
2022-12-16 10:27:53 -08:00
|
|
|
(use-package tool-bar
|
|
|
|
:ensure nil
|
|
|
|
:config
|
|
|
|
(tool-bar-mode 0))
|
|
|
|
(use-package menu-bar
|
|
|
|
:ensure nil
|
|
|
|
:config
|
|
|
|
(menu-bar-mode 0))
|
|
|
|
(use-package scroll-bar
|
|
|
|
:ensure nil
|
|
|
|
:config
|
|
|
|
(scroll-bar-mode 0))
|
|
|
|
|
2023-05-03 18:17:26 -07:00
|
|
|
(setq pixel-scroll-precision-large-scroll-height 40
|
|
|
|
fast-but-imprecise-scrolling t)
|
2022-12-21 17:40:08 -08:00
|
|
|
(pixel-scroll-precision-mode)
|
2022-12-16 10:27:53 -08:00
|
|
|
|
|
|
|
(setcar mouse-wheel-scroll-amount 3)
|
|
|
|
|
|
|
|
(setq server-client-instructions nil
|
|
|
|
scroll-step 1
|
2023-01-09 23:03:49 -08:00
|
|
|
scroll-margin 8
|
2022-12-16 10:27:53 -08:00
|
|
|
scroll-conservatively 9999
|
2022-12-31 14:10:38 -08:00
|
|
|
python-indent-guess-indent-offset nil
|
2022-12-16 10:27:53 -08:00
|
|
|
read-file-name-completion-ignore-case t
|
|
|
|
read-buffer-completion-ignore-case t
|
|
|
|
completion-ignore-case t
|
2023-01-23 21:28:42 -08:00
|
|
|
sentence-end-double-space nil
|
2023-02-07 22:22:13 -08:00
|
|
|
custom-safe-themes t
|
|
|
|
x-stretch-cursor t)
|
2022-12-16 10:27:53 -08:00
|
|
|
|
|
|
|
(setq-default c-basic-offset 4
|
2023-01-15 13:57:38 -08:00
|
|
|
c-ts-mode-indent-offset 4
|
2023-03-13 20:57:04 -07:00
|
|
|
json-ts-mode-indent-offset 4
|
2023-05-20 15:33:49 -07:00
|
|
|
sgml-basic-offset 4
|
2022-12-16 10:27:53 -08:00
|
|
|
tab-width 4
|
2024-09-06 15:29:22 -07:00
|
|
|
fill-column 78)
|
2023-07-20 23:27:00 -07:00
|
|
|
;; Because python-mode sets tab-width to 8 for some reason
|
2022-12-31 14:10:38 -08:00
|
|
|
(add-hook 'python-mode-hook (lambda () (setq tab-width 4)))
|
2022-12-16 10:27:53 -08:00
|
|
|
|
2023-01-21 17:31:58 -08:00
|
|
|
(column-number-mode)
|
|
|
|
(size-indication-mode)
|
|
|
|
|
2022-12-24 15:52:45 -08:00
|
|
|
(global-hl-line-mode)
|
|
|
|
|
2023-08-14 22:27:46 -07:00
|
|
|
(defun my-relative-linenum (&optional toggle)
|
2023-03-27 11:15:45 -07:00
|
|
|
"Simply enables relative line numbers."
|
2023-08-14 22:27:46 -07:00
|
|
|
(interactive "p")
|
|
|
|
(setq display-line-numbers (if (and toggle display-line-numbers) nil 'relative)))
|
2022-12-16 10:27:53 -08:00
|
|
|
(dolist (hook '(prog-mode-hook
|
2023-03-27 11:17:17 -07:00
|
|
|
conf-mode-hook))
|
2022-12-24 15:52:45 -08:00
|
|
|
(add-hook hook #'my-relative-linenum))
|
2022-12-16 10:27:53 -08:00
|
|
|
|
2022-12-24 15:52:45 -08:00
|
|
|
(defun my-use-spaces-for-indent ()
|
2023-09-30 00:24:22 -07:00
|
|
|
"Simply turn off `indent-tabs-mode'."
|
2022-12-16 10:27:53 -08:00
|
|
|
(setq indent-tabs-mode nil))
|
2022-12-24 15:52:45 -08:00
|
|
|
(dolist (hook '(emacs-lisp-mode-hook
|
|
|
|
lisp-mode-hook
|
|
|
|
scheme-mode-hook
|
|
|
|
clojure-mode-hook))
|
|
|
|
(add-hook hook #'my-use-spaces-for-indent))
|
2022-12-16 10:27:53 -08:00
|
|
|
|
2023-01-13 22:22:09 -08:00
|
|
|
(add-hook 'text-mode-hook #'word-wrap-whitespace-mode)
|
2023-03-29 10:29:50 -07:00
|
|
|
(add-hook 'text-mode-hook #'visual-line-mode)
|
2023-01-13 22:22:09 -08:00
|
|
|
|
2022-12-16 10:27:53 -08:00
|
|
|
(defun scroll-down-3 ()
|
2023-01-24 19:20:10 -08:00
|
|
|
"Scroll down by 3."
|
2022-12-16 10:27:53 -08:00
|
|
|
(interactive)
|
|
|
|
(scroll-down 3))
|
|
|
|
|
|
|
|
(defun scroll-up-3 ()
|
2023-01-24 19:20:10 -08:00
|
|
|
"Scroll up by 3."
|
2022-12-16 10:27:53 -08:00
|
|
|
(interactive)
|
|
|
|
(scroll-up 3))
|
|
|
|
|
2023-07-06 11:39:17 -07:00
|
|
|
(defun my-frame-make-detect-term (&optional frame)
|
2023-03-27 11:15:45 -07:00
|
|
|
"Check when FRAME are made in order to make terminal-only configurations."
|
2022-12-16 10:27:53 -08:00
|
|
|
(unless (display-graphic-p frame)
|
|
|
|
(xterm-mouse-mode)
|
|
|
|
(global-set-key (kbd "<mouse-4>") #'scroll-down-3)
|
|
|
|
(global-set-key (kbd "<mouse-5>") #'scroll-up-3)
|
2023-07-06 11:39:17 -07:00
|
|
|
(remove-hook 'after-make-frame-functions #'my-frame-make-detect-term)))
|
2022-12-16 10:27:53 -08:00
|
|
|
|
2023-01-24 19:20:10 -08:00
|
|
|
(if (daemonp)
|
2023-07-06 11:39:17 -07:00
|
|
|
(add-to-list 'after-make-frame-functions #'my-frame-make-detect-term)
|
|
|
|
(my-frame-make-detect-term))
|
2022-12-16 10:27:53 -08:00
|
|
|
|
2023-01-06 22:35:05 -08:00
|
|
|
(defun my-sudo-edit ()
|
|
|
|
"Edit current file as root."
|
|
|
|
(interactive)
|
|
|
|
(unless (and buffer-file-name
|
|
|
|
(file-writable-p buffer-file-name))
|
|
|
|
(find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name))))
|
|
|
|
|
2023-04-17 13:52:30 -07:00
|
|
|
(setq auto-mode-alist
|
|
|
|
(append '(("\\.yuck\\'" . lisp-mode)
|
2023-11-04 00:01:00 -07:00
|
|
|
("/flake\\.lock\\'" . js-json-mode))
|
2023-04-17 13:52:30 -07:00
|
|
|
auto-mode-alist
|
|
|
|
'(("/qutebrowser-editor-" . text-mode))))
|
2022-12-16 10:27:53 -08:00
|
|
|
|
2023-01-12 21:00:23 -08:00
|
|
|
(when (daemonp)
|
|
|
|
(with-current-buffer "*scratch*"
|
|
|
|
(cd "~/")))
|
2023-01-24 19:20:10 -08:00
|
|
|
|
2023-03-30 23:04:35 -07:00
|
|
|
(defvar my-ac-previous-status t
|
2024-04-23 00:43:11 -07:00
|
|
|
"Whether connected to AC during last check.")
|
2023-01-24 19:20:10 -08:00
|
|
|
|
|
|
|
(require 'battery)
|
|
|
|
(defun my-bat-check ()
|
2023-03-27 11:15:45 -07:00
|
|
|
"Check if battery status has changed.
|
2023-03-30 23:04:35 -07:00
|
|
|
Used to toggle `goggles-pulse', `pixel-scroll-precision-mode', and `nyan-mode'."
|
|
|
|
(let ((ac-status (not (string=
|
2024-04-23 00:43:11 -07:00
|
|
|
(cdr (assq ?B (funcall battery-status-function)))
|
|
|
|
"discharging"))))
|
2023-03-30 23:04:35 -07:00
|
|
|
(unless (eq ac-status my-ac-previous-status)
|
|
|
|
(setq my-ac-previous-status ac-status)
|
2023-01-24 19:20:10 -08:00
|
|
|
(when (boundp 'goggles-pulse)
|
2023-03-30 23:04:35 -07:00
|
|
|
(setq goggles-pulse ac-status))
|
|
|
|
(when nyan-mode
|
|
|
|
(if ac-status
|
|
|
|
(nyan-start-animation)
|
|
|
|
(nyan-stop-animation)))
|
|
|
|
(setq nyan-animate-nyancat ac-status
|
|
|
|
nyan-wavy-trail ac-status)
|
|
|
|
(pixel-scroll-precision-mode (if ac-status 1 0)))))
|
2023-01-24 19:20:10 -08:00
|
|
|
|
|
|
|
(when battery-status-function
|
2023-02-22 09:20:00 -08:00
|
|
|
(run-with-timer 0 30 #'my-bat-check))
|