2022-01-05 03:13:22 +00:00
;;; init.el --- Emacs initiation file -*- lexical-binding: t -*-
2021-09-05 04:51:36 +00:00
2021-11-22 05:57:41 +00:00
;; Author: Case Duckworth <acdw@acdw.net>
2021-03-01 05:58:57 +00:00
;; Created: Sometime during Covid-19, 2020
2021-02-26 17:31:50 +00:00
;; Keywords: configuration
2021-03-08 04:14:38 +00:00
;; URL: https://tildegit.org/acdw/emacs
2021-11-22 05:57:41 +00:00
;; Bankruptcy: 8
2021-03-16 16:16:21 +00:00
2021-04-10 19:28:31 +00:00
;;; License:
2021-09-05 04:51:36 +00:00
2021-11-22 05:57:41 +00:00
;; Everyone is permitted to do whatever they like with this software
;; without limitation. This software comes without any warranty
;; whatsoever, but with two pieces of advice:
2021-09-25 19:03:00 +00:00
;; - Be kind to yourself.
2021-03-01 05:58:57 +00:00
;; - Make good choices.
2021-03-16 16:16:21 +00:00
2022-05-06 15:23:02 +00:00
;;; Commentary
;; My init.el. There are many like it, but this one is mine.
;; Ideas:
;; [[https://emacs.stackexchange.com/questions/17278/truncate-only-certain-lines-and-use-continuation-lines-elsewhere][Truncate org-mode headings]]
;; [[https://emacs.stackexchange.com/questions/7432/make-visual-line-mode-more-compatible-with-org-mode][another link that might be useful for truncating]]
2021-09-25 19:03:00 +00:00
;;; Code:
2022-02-07 04:17:56 +00:00
2022-01-05 23:12:32 +00:00
( let ( ( early-features ` ( ( early-init . , ( locate-user-emacs-file " early-init " ) )
acdw private +key ) ) )
( dolist ( feature early-features )
( require ( or ( car-safe feature ) feature ) ( cdr-safe feature ) :noerror ) ) )
2021-12-18 20:34:02 +00:00
2022-01-04 20:39:54 +00:00
( setup ( :require +casing )
2022-04-13 03:39:52 +00:00
( :global " M-u " #' universal-argument )
2022-01-05 23:12:32 +00:00
( +casing-mode +1 ) )
2022-01-04 20:39:54 +00:00
2021-12-06 04:37:11 +00:00
( setup ( :require +emacs )
2021-12-30 18:26:56 +00:00
;; +emacs.el contains super-basic defaults that are basically necessary for
;; good functioning. In this block, I add extra things or more "experimental"
;; ones that might not belong in a separate file.
2022-01-04 06:40:11 +00:00
( :also-load +lisp )
2022-01-03 21:17:18 +00:00
( :option truncate-string-ellipsis " … " )
2021-12-30 18:26:56 +00:00
;; Bindings
2021-12-31 03:14:06 +00:00
( :global " C-x C-k " #' kill-current-buffer
2021-12-30 04:55:55 +00:00
" C-x 4 n " #' clone-buffer
" C-c v " #' visible-mode
2022-01-05 23:12:32 +00:00
" C-M-; " #' +lisp-comment-or-uncomment-sexp
2022-01-06 21:47:42 +00:00
" M-j " nil
" C-x o " ( lambda ( ) ( interactive ) ( switch-to-buffer nil ) )
" C-x C-o " #' +open-paragraph
2022-01-07 04:55:26 +00:00
" C-w " #' +kill-word-backward-or-region
2022-04-02 18:54:52 +00:00
" C-x C-m " #' execute-extended-command ; original: coding systems
2022-04-24 20:00:11 +00:00
" C-<backspace> " #' +backward-kill-word
2022-05-01 14:28:11 +00:00
" C-x TAB " #' +indent-rigidly
2022-04-12 18:17:30 +00:00
;; Alright, Yegge... NOPE! C-x t is tab prefix ... (maybe F6 or something?)
;; "C-x t" #'beginning-of-buffer
;; "C-x e" #'end-of-buffer
2022-01-10 02:52:07 +00:00
)
2022-05-01 14:21:39 +00:00
;; C-h deletes backward - see https://idiomdrottning.org/bad-emacs-defaults
2021-12-06 04:37:11 +00:00
( global-set-key ( kbd " C-h " ) 'delete-backward-char )
2021-12-29 04:15:12 +00:00
( keyboard-translate ?\C -h ?\C -? )
2022-04-20 15:44:51 +00:00
;; Faces
( dolist ( face ' ( line-number
line-number-major-tick
line-number-minor-tick
line-number-current-line ) )
( :face face ' ( ( t ( :inherit fixed-pitch ) ) ) ) )
2022-01-06 21:47:42 +00:00
;; Hooks
2022-04-12 18:17:30 +00:00
( add-hook 'prog-mode-hook #' turn-on-auto-fill )
( add-hook 'prog-mode-hook #' font-lock-todo-insinuate )
( add-hook 'text-mode-hook #' turn-on-auto-fill )
( add-hook 'special-mode-hook #' turn-off-auto-fill )
2022-01-06 21:47:42 +00:00
;; Advice
2021-12-30 18:27:39 +00:00
;; https://old.reddit.com/r/emacs/comments/rlli0u/whats_your_favorite_defadvice/hph14un/
2021-12-29 04:14:43 +00:00
( define-advice keyboard-escape-quit ( :around ( fn &rest r ) )
" Don't close splits on `keyboard-escape-quit' . "
( let ( ( buffer-quit-function #' ignore ) )
2021-12-30 18:27:39 +00:00
( apply fn r ) ) ) )
2021-04-29 17:16:03 +00:00
2021-11-22 05:57:41 +00:00
( setup ( :require +init )
2022-02-07 23:07:37 +00:00
( :local-hook user-save-hook #' +init-sort )
2022-04-28 20:48:46 +00:00
( +with-ensure-after-init
2022-05-01 14:21:39 +00:00
( :hook #' +init-add-setup-to-imenu ) ) )
2021-04-29 17:16:03 +00:00
2021-12-06 04:37:41 +00:00
( setup ( :require auth-source )
2022-02-03 00:28:39 +00:00
( :option auth-sources ( list 'default
2022-02-07 04:17:56 +00:00
" secrets:passwords "
2022-01-31 06:54:22 +00:00
( private/ " authinfo " ) ) )
2022-01-25 22:55:55 +00:00
( :with-mode authinfo-mode
( :local-set truncate-lines t ) ) )
2021-12-06 04:37:41 +00:00
2022-04-20 15:44:51 +00:00
( setup ( :require autoinsert )
2022-05-01 14:21:39 +00:00
;; (auto-insert-mode +1)
2022-02-23 16:16:48 +00:00
)
2022-02-07 04:17:56 +00:00
2022-01-04 21:30:33 +00:00
( setup ( :require cus-edit )
;; I don't use Custom to actually /make/ any customizations, but it's handy to
;; (A) see what options are available and (B) persist some changes across
;; restarts, for example, `safe-local-variables'.
( :require +cus-edit )
( :option custom-file ( private/ " custom.el " )
custom-magic-show nil
custom-magic-show-button t
custom-raised-buttons nil
custom-unlispify-tag-names nil
custom-variable-default-form 'lisp )
( dolist ( var ' ( safe-local-variable-values
warning-suppress-types ) )
( add-to-list '+custom-variable-allowlist var ) )
2022-04-20 15:44:51 +00:00
( +ensure-after-init
( +custom-load-ignoring-most-customizations ) )
2022-01-04 21:30:33 +00:00
( 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 ) ) )
2022-05-06 15:23:02 +00:00
( setup ( :require find-script ) )
2021-12-18 00:31:24 +00:00
( setup ( :require goto-addr )
( if ( fboundp #' global-goto-address-mode )
( global-goto-address-mode )
( add-hook 'after-change-major-mode-hook #' goto-address-mode ) ) )
2021-12-06 04:37:41 +00:00
( setup ( :require pulse )
( :also-load +pulse )
( :option pulse-flag nil
pulse-delay 0.5
2021-12-30 04:55:55 +00:00
pulse-iterations 1 )
2022-01-10 02:52:07 +00:00
( dolist ( command ' ( +ace-window-or-switch-buffer
2022-04-20 15:47:36 +00:00
pop-mark pop-global-mark
2022-04-24 20:01:58 +00:00
Info-history-back Info-history-forward
) )
2022-01-10 02:52:07 +00:00
( add-to-list '+pulse-location-commands command ) )
2022-01-03 21:17:33 +00:00
( +ensure-after-init #' +pulse-location-mode ) )
2021-12-06 04:37:41 +00:00
2021-12-29 04:15:12 +00:00
( setup ( :require reading )
2022-01-14 00:01:12 +00:00
;;(:hook-into view-mode) ; XXX doesn't go back
2022-01-11 05:52:11 +00:00
)
2021-12-26 19:03:24 +00:00
2022-01-06 21:47:09 +00:00
( setup ( :require user-save )
2022-01-07 23:30:46 +00:00
( add-hook 'user-save-hook #' +clean-empty-lines )
2022-04-24 20:01:58 +00:00
( add-hook 'user-save-hook ( defun user-save@save-some-buffers ( )
( save-some-buffers t t ) ) )
2022-02-07 19:14:10 +00:00
( user-save-global-mode +1 ) )
2022-01-06 21:47:09 +00:00
2022-03-30 23:14:56 +00:00
( setup ( :require winner )
( winner-mode +1 ) )
2022-01-05 23:12:32 +00:00
( setup +key
( +ensure-after-init #' +key-global-mode ) )
2022-04-20 15:44:51 +00:00
( setup _work
2022-05-01 14:21:39 +00:00
( +with-ensure-after-init
( require '_work ) ) )
2022-04-12 18:17:42 +00:00
2021-12-18 00:31:24 +00:00
( setup abbrev
( :option abbrev-file-name ( sync/ " abbrev.el " )
save-abbrevs 'silent )
2022-05-01 14:21:39 +00:00
( with-eval-after-load 'user-save
2022-03-30 23:14:56 +00:00
( :with-mode edit-abbrevs-mode
( :hook #' turn-off-user-save-mode ) ) )
2021-12-18 00:31:24 +00:00
( :hook-into text-mode
circe-chat-mode ) )
( setup autorevert
( :option global-auto-revert-non-file-buffers t
auto-revert-verbose nil )
( global-auto-revert-mode +1 ) )
2022-01-31 06:54:15 +00:00
( setup bookmark
( :option bookmark-save-flag 1
bookmark-watch-bookmark-file 'silent ) )
2021-12-18 00:31:24 +00:00
( setup browse-url
( :require +browse-url )
2021-12-31 21:46:16 +00:00
( :option
browse-url-browser-function #' eww-browse-url
2022-01-03 21:18:05 +00:00
+browse-url-browser-function browse-url-browser-function
2022-01-10 02:52:07 +00:00
browse-url-generic-program ( seq-some #' executable-find
' ( " firefox "
" chromium "
" chrome " ) )
2022-01-21 22:34:55 +00:00
browse-url-chrome-program ( seq-some #' executable-find
' ( " chromium "
" chrome "
" google-chrome-stable " ) )
2022-01-10 02:52:07 +00:00
browse-url-generic-args ( seq-some ( lambda ( e )
( when ( equal ( executable-find ( car e ) )
browse-url-generic-program )
( cdr e ) ) )
' ( ( " firefox " " --new-tab " ) ) )
2021-12-31 21:46:16 +00:00
browse-url-secondary-browser-function ( if ( executable-find " firefox " )
#' browse-url-firefox
#' browse-url-default-browser )
browse-url-new-window-flag nil
browse-url-firefox-arguments ' ( " --new-tab " )
2022-01-17 19:45:32 +00:00
browse-url-firefox-new-window-is-tab t )
( defvar +invidious-host
;; TODO: Add variables for other transformations and what-not.
2022-04-12 18:17:54 +00:00
;; ... or enable trying multiple servers
2022-01-17 19:45:32 +00:00
" invidious.snopyta.org "
" Host for invidious instance. " )
2021-12-31 21:46:16 +00:00
;; Set up external browsing URLs.
2022-01-04 20:41:46 +00:00
( add-to-list '+custom-variable-allowlist
'+browse-url-secondary-browser-regexps )
2022-02-17 05:14:52 +00:00
( dolist ( domain ' ( " github.com " " gitlab.com " " google.com "
" imgur.com " " twitch.tv "
2022-01-04 20:41:46 +00:00
" pixelfed " " instagram.com " " bibliogram.art "
" reddit.com " " teddit.net "
2022-01-14 00:01:12 +00:00
" twitter.com " " nitter.net " " t.co "
" streamable.com " " spotify.com "
2022-02-17 05:14:52 +00:00
" hetzner.cloud "
" melpa.org " ) )
2022-01-14 00:01:12 +00:00
( add-to-list '+browse-url-secondary-browser-regexps
( replace-regexp-in-string " \\ . " " \\ \\ . " domain ) ) )
2021-12-18 00:31:24 +00:00
;; Set up URL handlers.
2022-04-12 18:18:08 +00:00
( :option browse-url-handlers
( list
( cons ( rx ; images
" . " ( or " jpeg " " jpg " " png " " bmp " ) eos )
( lambda ( &rest args )
( apply
( cond ( ( executable-find " mpv " ) #' +browse-image-with-mpv )
( t #' eww-browse-url ) )
args ) ) )
( cons ( rx ( or ;; videos
" youtube.com " " youtu.be " " invidious " " yewtu.be "
( seq " . " ( or " mp4 " " gif " " mov " " MOV " " webm " ) eos )
;; music
" soundcloud.com " " bandcamp.com "
( seq " . " ( or " ogg " " mp3 " " opus " " m4a " ) eos ) ) )
( lambda ( &rest args )
( apply ( if ( executable-find " mpv " )
#' +browse-url-with-mpv
browse-url-secondary-browser-function )
args ) ) )
( cons ( +browse-url-secondary-browser-regexps-combine ) ; non-text websites
( lambda ( &rest args )
( apply browse-url-secondary-browser-function args ) ) )
( cons " xkcd \\ .com "
( lambda ( &rest args )
( apply ( if ( fboundp #' xkcd-get )
( progn ( require '+xkcd )
#' +xkcd-get-from-url )
+browse-url-browser-function )
args ) ) )
( cons " . " ; everything else
( lambda ( &rest args )
( apply +browse-url-browser-function args ) ) ) ) )
( with-eval-after-load 'chd
( add-to-list 'browse-url-handlers
( cons chd/url-regexps #' browse-url-chrome ) ) )
2021-12-18 00:31:24 +00:00
;; Transform URLs before passing to `browse-url'
2022-01-17 07:10:01 +00:00
( :option +browse-url-transformations ` ( ( , ( rx ( or " youtube.com "
" youtu.be " ) )
2022-02-07 23:09:04 +00:00
. , +invidious-host )
2022-05-06 15:23:02 +00:00
( " twitter \\ .com " . " nitter.net " )
( " instagram \\ .com " . " bibilogram.art " )
2021-12-20 04:11:39 +00:00
( , ( rx ( or " reddit.com "
" old.reddit.com " ) )
2022-02-07 23:09:04 +00:00
. " teddit.net " )
2022-05-06 15:23:02 +00:00
( " medium \\ .com " . " scribe.rip " )
( " www \\ .npr \\ .org " . " text.npr.org " )
;;TODO: Various paste sites
) )
2021-12-18 00:31:24 +00:00
( +browse-url-transform-url-global-mode +1 ) )
2021-07-01 00:34:06 +00:00
( setup calendar
2021-11-22 05:57:41 +00:00
( require '_location )
2022-02-19 00:25:27 +00:00
( :option diary-file ( private/ " diary " ) ) )
2022-01-03 21:18:33 +00:00
2021-12-31 05:07:58 +00:00
( setup compile
2022-05-01 14:21:51 +00:00
( :require +compile )
( :+key " <f5> " #' +compile-dispatch )
2021-12-31 05:07:58 +00:00
( :option compilation-always-kill t
compilation-ask-about-save nil
compilation-scroll-output t ) )
2021-09-04 15:38:06 +00:00
( setup dired
2022-04-28 20:49:22 +00:00
( :require dired-x +dired )
2022-04-20 03:27:03 +00:00
( :straight dired+ )
2022-01-02 01:25:35 +00:00
( :option dired-recursive-copies 'always
dired-recursive-deletes 'always
2022-01-04 04:32:31 +00:00
dired-create-destination-dirs 'always
dired-do-revert-buffer t
dired-hide-details-hide-symlink-targets nil
dired-isearch-filenames 'dwim
2021-09-05 04:57:04 +00:00
delete-by-moving-to-trash t
2022-01-04 04:32:31 +00:00
dired-auto-revert-buffer t
2022-02-17 05:15:21 +00:00
dired-listing-switches " -AlF "
2021-09-05 04:57:04 +00:00
ls-lisp-dirs-first t
dired-ls-F-marks-symlinks t
2022-01-04 04:32:31 +00:00
dired-clean-confirm-killing-deleted-buffers nil
2022-01-03 16:37:03 +00:00
dired-no-confirm ' ( byte-compile
load chgrp chmod chown
2021-12-30 04:55:55 +00:00
copy move hardlink symlink
shell touch )
2021-09-05 04:57:04 +00:00
dired-dwim-target t )
2022-01-10 02:52:07 +00:00
( :local-set truncate-lines t )
2022-04-12 18:16:15 +00:00
( :bind " <backspace> " #' dired-up-directory
" j " #' +dired-goto-file )
2022-02-17 05:15:21 +00:00
( :hook #' dired-hide-details-mode
#' hl-line-mode
2022-04-28 20:49:22 +00:00
#' lin-mode
#' +dired-dim-git-ignores )
2022-05-05 23:41:21 +00:00
( +with-ensure-after-init ; Necessary because jabber loads later
( :+key " C-x C-j " #' dired-jump ) )
2022-02-07 04:17:56 +00:00
( dolist ( refresh-after-func ' ( dired-do-flagged-delete ) )
( advice-add refresh-after-func :after #' revert-buffer ) )
2021-11-22 05:57:41 +00:00
( with-eval-after-load 'frowny
2021-12-30 04:55:55 +00:00
( add-to-list 'frowny-inhibit-modes #' dired-mode ) ) )
2021-04-29 17:16:03 +00:00
2021-12-05 05:09:33 +00:00
( setup eldoc
( :hook-into elisp-mode
lisp-interaction-mode ) )
( setup elisp-mode
( :also-load +elisp )
( :option eval-expression-print-length nil
eval-expression-print-level nil )
( :with-map ( emacs-lisp-mode-map lisp-interaction-mode-map )
2021-12-29 00:20:07 +00:00
( :bind " C-c C-c " #' eval-defun
" C-c C-k " #' +elisp-eval-region-or-buffer
" C-c C-z " #' ielm ) )
( advice-add #' eval-region :around #' +eval-region@pulse ) )
2021-12-05 05:09:33 +00:00
2021-04-29 17:16:03 +00:00
( setup eshell
2022-01-17 19:45:32 +00:00
( :also-load em-smart
2021-09-06 17:51:48 +00:00
em-tramp )
2022-01-17 19:45:32 +00:00
( :require +eshell )
( +define-dir eshell/ ( locate-user-emacs-file " eshell " )
" Where to place Eshell-specific files. " )
( :option eshell-aliases-file ( eshell/ " aliases " )
;; What are these for???
eshell-rc-script ( eshell/ " profile " )
eshell-login-script ( eshell/ " login " )
2021-09-06 17:51:48 +00:00
eshell-destroy-buffer-when-process-dies t
2022-01-17 19:45:32 +00:00
eshell-directory-name eshell/
2021-09-06 17:51:48 +00:00
eshell-error-if-no-glob t
eshell-hist-ignore-dups t
2021-05-30 05:07:02 +00:00
eshell-kill-on-exit nil
2021-11-22 05:57:41 +00:00
eshell-prefer-lisp-functions t
eshell-prefer-lisp-variables t
2021-05-30 05:07:02 +00:00
eshell-review-quick-commands nil
2021-09-06 17:51:48 +00:00
eshell-save-history-on-exit t
eshell-scroll-to-bottom-on-input 'all
2021-05-30 05:07:02 +00:00
eshell-smart-space-goes-to-end t
2022-01-17 05:31:16 +00:00
eshell-where-to-jump 'begin
2022-01-31 06:54:53 +00:00
eshell-banner-message " "
eshell-prompt-regexp ( rx bol ( * ( not ( any ?# ?$ ?\n ) ) )
" " ( any ?# ?$ )
( * " " ) ) )
2022-04-02 18:53:59 +00:00
( :+leader " s " #' +eshell-here
" C-s " #' +eshell-here )
2022-01-17 19:45:32 +00:00
( with-eval-after-load 'mwim
( setf ( alist-get 'eshell-mode mwim-beginning-of-line-function )
#' eshell-bol ) )
2022-01-17 05:13:11 +00:00
( +eshell-eval-after-load
2022-01-17 19:45:32 +00:00
;; Local modes
( dolist ( mode ' ( ( hungry-delete-mode . -1 ) ) )
( funcall ( car mode ) ( cdr mode ) ) )
2022-01-17 05:13:11 +00:00
;; Set local settings
2022-04-02 18:54:06 +00:00
( dolist ( setting ` ( ( outline-regexp . , eshell-prompt-regexp )
( page-delimiter . , eshell-prompt-regexp )
( imenu-generic-expression " Prompt "
, ( concat eshell-prompt-regexp
" \\ (.* \\ ) " )
1 )
( truncate-lines . t )
( scroll-margin . 0 ) ) )
2022-01-17 05:13:11 +00:00
( set ( make-local-variable ( car setting ) ) ( cdr setting ) ) )
;; Bind keys
( dolist ( binding ' ( ( " C-d " . +eshell-quit-or-delete-char ) ) )
( define-key eshell-mode-map
2022-05-05 23:41:21 +00:00
( kbd ( car binding ) ) ( cdr binding ) ) )
2022-01-17 05:13:11 +00:00
;; Environment variables
( dolist ( environment ' ( ( " PAGER " . " cat " ) ) )
( setenv ( car environment ) ( cdr environment ) ) ) ) )
2021-11-22 05:57:41 +00:00
2021-12-26 19:03:24 +00:00
( setup eww
2021-12-27 04:49:25 +00:00
( :also-load +eww )
( :option eww-search-prefix " https://duckduckgo.com/html?q= "
url-privacy-level ' ( email agent cookies lastloc ) )
2021-12-29 00:20:07 +00:00
( add-hook 'eww-after-render-hook #' reading-mode )
( :hook #' +eww-bookmark-setup
#' +eww-track-readable-mode )
( :bind " b " #' bookmark-set
" B " #' bookmark-jump
2021-12-27 04:49:25 +00:00
" M-n " nil
" M-p " nil ) )
2021-12-26 19:03:24 +00:00
2022-01-05 23:12:32 +00:00
( setup flyspell
( :hook-into org-mode ) )
2021-12-29 00:20:24 +00:00
( setup hideshow
( :also-load +hideshow )
( :with-mode hs-minor-mode
( :hook-into prog-mode )
( :bind " C-<tab> " #' +hs-cycle
" C-S-<tab> " #' +hs-global-cycle
;; but y tho
" C-S-<iso-lefttab> " #' +hs-global-cycle ) ) )
2021-12-26 19:05:13 +00:00
( setup ibuffer
( :also-load ibuf-ext )
( :option ibuffer-expert t
ibuffer-show-empty-filter-groups nil
ibuffer-saved-filter-groups
' ( ( " default "
( " Org " ( mode . org-mode ) )
( " emacs " ( or ( name . " ^ \\ *scratch \\ *$ " )
( name . " ^ \\ *Messages \\ *$ " )
( name . " ^ \\ *Warnings \\ *$ " )
( name . " ^ \\ *straight-process \\ *$ " )
( name . " ^ \\ *Calendar \\ *$ " ) ) )
( " customize " ( mode . Custom-mode ) )
( " emacs-config " ( or ( filename . " .emacs.d " )
( mode . +init-mode ) ) )
( " git " ( or ( name . " ^ \* magit " )
( name . " ^ \m agit " ) ) )
( " help " ( or ( mode . help-mode )
( mode . Info-mode )
( mode . helpful-mode ) ) )
( " irc " ( or ( mode . erc-mode )
( mode . circe-server-mode )
( mode . circe-channel-mode ) ) )
( " shell " ( or ( mode . eshell-mode )
( mode . shell-mode )
( mode . vterm-mode ) ) )
( " web " ( or ( mode . elpher-mode )
( mode . eww-mode ) ) ) ) ) )
( :hook ( defun ibuffer@filter-to-default ( )
( ibuffer-auto-mode +1 )
( ibuffer-switch-to-saved-filter-groups " default " ) ) ) )
2022-01-05 05:57:39 +00:00
( setup info
( :also-load +Info )
2022-04-02 18:55:44 +00:00
( dolist ( dir ( split-string ( getenv " INFOPATH " ) " : " t ) )
( add-to-list 'Info-additional-directory-list dir ) )
2022-01-05 05:57:39 +00:00
( :with-mode Info-mode ; -_-
( :hook #' reading-mode )
2022-05-05 23:41:42 +00:00
( :local-set +modeline-buffer-position #' +Info-modeline-breadcrumbs
+modeline-position-function #' ignore )
2022-01-05 05:57:39 +00:00
( :bind " c " #' +Info-copy-current-node-name
" w " #' +Info-copy-current-node-name ) ) )
2022-01-25 22:56:48 +00:00
( setup ispell
( :also-load +ispell )
2022-04-13 03:40:00 +00:00
( :option ispell-program-name ( or ( executable-find " ispell " )
( executable-find " aspell " ) ) )
2022-01-28 01:26:33 +00:00
( put 'ispell-buffer-session-localwords
'safe-local-variable #' +ispell-safe-local-p )
( add-hook 'user-save-hook #' +ispell-move-buffer-words-to-dir-locals-hook ) )
2022-01-25 22:56:48 +00:00
2021-12-29 01:40:03 +00:00
( setup kmacro
( :also-load +kmacro )
( with-eval-after-load '+kmacro
2022-02-17 05:16:31 +00:00
;; (+kmacro-recording-indicator-mode +1)
2021-12-29 01:40:03 +00:00
( +kmacro-block-undo-mode +1 ) ) )
2021-12-18 00:30:22 +00:00
( setup minibuffer
( :require +minibuffer )
( :with-map minibuffer-local-map
2021-12-29 00:20:07 +00:00
( :bind " M-/ " #' +minibuffer-complete-history ) ) )
2021-12-30 18:27:55 +00:00
( setup mouse
;; Brand new for Emacs 28: see https://ruzkuku.com/texts/emacs-mouse.html
2021-12-31 03:14:06 +00:00
;; Actually, look at this as well: https://www.emacswiki.org/emacs/Mouse3
2021-12-30 18:27:55 +00:00
( when ( fboundp 'context-menu-mode )
2022-01-18 23:18:06 +00:00
( :option context-menu-functions
' ( context-menu-ffap
context-menu-region
context-menu-undo
2022-05-06 15:23:02 +00:00
;; context-menu-dictionary
) )
2022-01-11 22:01:03 +00:00
( context-menu-mode +1 ) )
2022-01-18 23:18:06 +00:00
( dolist ( click ' ( ;; Fix scrolling in the margin
2022-01-11 22:01:03 +00:00
wheel-down double-wheel-down triple-wheel-down
wheel-up double-wheel-up triple-wheel-up ) )
( global-set-key ( vector 'right-margin click ) 'mwheel-scroll )
( global-set-key ( vector 'left-margin click ) 'mwheel-scroll ) ) )
2021-12-30 18:27:55 +00:00
2022-01-25 22:57:30 +00:00
( setup net-utils
2022-05-06 15:23:02 +00:00
( :needs " traceroute " )
2022-01-25 22:57:30 +00:00
( :require +finger ) ; fixes `finger' to use var below
( :option finger-X.500-host-regexps ' ( " . " ) ; only send username
2022-05-06 15:23:02 +00:00
)
( require 'transient )
( transient-define-prefix net-utils ( )
" Networking utilities "
[ " Actions "
( " p " " Ping " ping )
( " i " " Ifconfig " ifconfig )
( " w " " Iwconfig " iwconfig )
( " n " " Netstat " netstat )
( " a " " Arp " arp )
( " r " " Route " route )
( " h " " Nslookup host " nslookup-host )
( " d " " Dig " dig )
( " s " " Smb Client " smbclient )
( " t " " Traceroute " traceroute ) ] )
( :+key " C-z M-n " #' net-utils ) )
2022-01-25 22:57:30 +00:00
2022-02-07 19:14:29 +00:00
( setup notmuch
2022-02-19 00:25:27 +00:00
( :load-from " ~/usr/share/emacs/site-lisp/ " )
2022-04-20 15:44:51 +00:00
( :load-after bbdb )
2022-02-22 04:40:35 +00:00
( :also-load +notmuch +message )
2022-02-19 00:25:27 +00:00
( +define-dir notmuch/ ( sync/ " emacs/notmuch " )
2022-02-17 05:16:31 +00:00
" Notmuch configuration and data. " )
2022-02-19 00:25:27 +00:00
( :option notmuch-init-file ( notmuch/ " notmuch-init.el " t )
2022-02-17 05:16:31 +00:00
notmuch-address-save-filename ( notmuch/ " addresses " t )
2022-02-07 19:14:29 +00:00
notmuch-address-use-company ( featurep 'company )
2022-03-30 23:14:56 +00:00
notmuch-search-oldest-first nil
notmuch-archive-tags ' ( " -inbox " " -unread " ) )
2022-04-13 15:15:44 +00:00
;; Reading mail
( :option notmuch-show-indent-content nil )
( add-hook 'notmuch-show-mode-hook #' visual-fill-column-mode )
2022-02-07 19:14:29 +00:00
;; Composing mail
2022-02-22 04:40:35 +00:00
( :option message-kill-buffer-on-exit t
message-auto-save-directory " ~/var/mail/drafts " )
2022-02-07 19:14:29 +00:00
;; Sending mail
( :option send-mail-function #' sendmail-send-it
mail-specify-envelope-from t
message-sendmail-envelope-from 'header
2022-02-17 05:16:31 +00:00
mail-envelope-from 'header )
;; Extras and fixes
2022-02-19 00:25:27 +00:00
( with-eval-after-load 'notmuch
( load notmuch-init-file :noerror )
2022-02-22 04:40:35 +00:00
( add-hook 'message-setup-hook #' +message-signature-setup )
2022-02-19 00:25:27 +00:00
( add-hook 'message-send-hook #' +send-mail-dispatch )
( advice-add 'notmuch-tag :filter-args #' +notmuch-correct-tags )
( :option notmuch-saved-searches ( list
( list :name " inbox "
:query ( +notmuch-query-concat " tag:inbox "
" NOT tag:Spam " )
:key " i " )
2022-02-23 16:15:50 +00:00
( list :name " lists "
:query ( +notmuch-query-concat " tag:/List/ "
" tag:unread " )
:key " l " )
2022-02-19 00:25:27 +00:00
( list :name " unread "
:query ( +notmuch-query-concat " tag:unread "
" NOT tag:Spam " )
:key " u " )
( list :name " flagged " :query " tag:flagged " :key " f " )
( list :name " sent " :query " tag:sent " :key " t " )
( list :name " drafts " :query " tag:draft " :key " d " )
( list :name " all mail " :query " * " :key " a " ) ) ) )
( :+leader " m " #' +notmuch-goto " C-m " #' +notmuch-goto
2022-04-20 15:44:51 +00:00
" n " #' notmuch " C-n " #' notmuch )
;; For `focus'
( put 'notmuch-message 'bounds-of-thing-at-point 'notmuch-show-message-extent ) )
2022-02-07 19:14:29 +00:00
2022-01-03 05:32:06 +00:00
( setup org
;; Plain org with the `setup' form for sorting, but I install with straight.
2022-01-03 16:37:03 +00:00
( :straight ( org
:type git :host nil
:repo " https://git.savannah.gnu.org/git/emacs/org-mode.git "
:local-repo " org "
:depth full
:pre-build ( straight-recipes-org-elpa--build )
:build ( :not autoloads )
:files ( :defaults
" lisp/*.el "
2022-04-20 03:27:03 +00:00
( " etc/styles/ " " etc/styles/* " ) ) ) )
( :straight ( org-contrib
2022-01-03 16:37:03 +00:00
:type git :host nil
:repo " https://git.sr.ht/~bzg/org-contrib " ) )
2022-01-03 05:32:06 +00:00
;; DO NOT load system-installed org !!!
2022-04-20 03:24:44 +00:00
( setq load-path
( cl-remove-if ( lambda ( path ) ( string-match-p " lisp/org \\ ' " path ) ) load-path ) )
2022-04-12 18:18:41 +00:00
( :also-load +org )
2022-01-03 05:32:06 +00:00
( :option org-adapt-indentation nil
2022-04-20 15:44:51 +00:00
org-auto-align-tags t
2022-01-03 05:32:06 +00:00
org-archive-mark-done t
org-catch-invisible-edits 'show-and-error
org-clock-clocked-in-display 'mode-line
org-clock-frame-title-format ( cons
' ( t org-mode-line-string )
( cons " --- " frame-title-format ) )
org-clock-string-limit 7 ; just the clock bit
;; org-clock-string-limit 25 ; gives enough information
org-clock-persist t
org-confirm-babel-evaluate nil
org-cycle-separator-lines 0
2022-01-03 21:17:18 +00:00
org-directory ( sync/ " org/ " t )
org-ellipsis truncate-string-ellipsis
2022-01-03 05:32:06 +00:00
org-fontify-done-headline t
org-fontify-quote-and-verse-blocks t
org-fontify-whole-heading-line t
2022-05-06 15:23:02 +00:00
org-hide-emphasis-markers nil
2022-01-03 05:32:06 +00:00
org-html-coding-system 'utf-8-unix
org-image-actual-width ( list ( * ( window-font-width )
( - fill-column 8 ) ) )
org-imenu-depth 3
2022-04-12 18:18:41 +00:00
org-indent-indentation-per-level 0
org-indent-mode-turns-on-hiding-stars nil
2022-04-20 15:44:51 +00:00
org-insert-heading-respect-content t
2022-01-03 05:32:06 +00:00
org-list-demote-modify-bullet ' ( ( " - " . " + " )
2022-04-13 15:15:59 +00:00
( " + " . " - " ) )
2022-01-03 05:32:06 +00:00
org-log-done 'time
org-log-into-drawer t
2022-03-30 23:14:56 +00:00
org-num-skip-commented t
org-num-skip-unnumbered t
org-num-skip-footnotes t
2022-01-03 05:32:06 +00:00
org-outline-path-complete-in-steps nil
org-pretty-entities t
org-pretty-entities-include-sub-superscripts nil
2022-01-14 23:20:23 +00:00
org-refile-targets ' ( ( nil . ( :maxlevel . 2 ) )
( org-agenda-files . ( :maxlevel . 1 ) ) )
2022-01-03 05:32:06 +00:00
org-refile-use-outline-path 'file
org-special-ctrl-a/e t
org-special-ctrl-k t
org-src-fontify-natively t
org-src-tab-acts-natively t
org-src-window-setup 'current-window
org-startup-truncated nil
org-startup-with-inline-images t
2022-04-20 15:44:51 +00:00
org-tags-column 1 ;; (- (- fill-column (length org-ellipsis)))
2022-03-12 02:04:05 +00:00
org-todo-keywords ' ( ( sequence " TODO(t) " " WAIT(w@/!) " " ONGOING(o@) "
2022-02-07 23:09:04 +00:00
" | " " DONE(d!) " )
2022-01-21 15:28:33 +00:00
( sequence " | " " CANCELED(k@) " )
2022-03-12 02:04:05 +00:00
( sequence " MEETING(m) " )
( sequence " ASSIGNED(a@/!) " " REVIEW(r) " " | " " DONE(d!) " ) )
2022-03-30 23:14:56 +00:00
org-use-speed-commands t
2022-02-17 05:16:50 +00:00
org-emphasis-alist ' ( ( " * " org-bold )
( " / " org-italic )
( " _ " org-underline )
( " = " org-verbatim )
( " ~ " org-code )
( " + " org-strikethrough ) ) )
2022-04-24 20:01:58 +00:00
;; (setq org-todo-keywords
;; '((sequence
;; "TODO(t)"
;; "NEXT(n!)" ; next action
;; "DONE(d)" ; done)
;; (sequence
;; "WAIT(w@)" ; waiting to be actionable again
;; "HOLD(h@/!)" ; actinable, but will do later
;; "IDEA(i)" ; maybe someday
;; "KILL(k@/!)" ; cancelled, aborted or is no longer applicable
;; ))))
2022-01-03 05:32:06 +00:00
( :bind " RET " #' +org-return-dwim
" <S-return> " #' +org-table-copy-down
" C-c C-l " #' +org-insert-link-dwim
" C-c C-n " #' +org-next-heading-widen
2022-01-07 23:30:46 +00:00
" C-c C-p " #' +org-previous-heading-widen
2022-01-19 00:16:01 +00:00
" C-c C-o " #' +org-open-at-point-dwim
" ` " #' +org-insert-tilde
2022-05-06 15:23:02 +00:00
" ~ " #' +org-insert-backtick
" C-c C-x l " #' org-toggle-link-display
" C-c C-x m " ( lambda ( ) ( interactive )
( setq-local org-hide-emphasis-markers
( not org-hide-emphasis-markers ) )
( font-lock-update ) )
" C-c C-x r " #' +org-drawer-list-add-resource
" C-M-k " #' kill-paragraph
" C-M-t " #' transpose-paragraphs )
2022-02-28 15:39:01 +00:00
( :global [ f8 ] #' org-clock-in
2022-04-13 03:40:11 +00:00
[ f9 ] #' org-clock-out
" C-c l " #' org-store-link )
2022-04-12 18:17:30 +00:00
( :hook #' variable-pitch-mode
#' turn-off-auto-fill
2022-04-20 15:44:51 +00:00
#' org-indent-mode
#' prettify-symbols-mode
2022-05-01 14:24:57 +00:00
#' +org-wrap-on-hyphens )
( :local-set prettify-symbols-alist ' ( ( " DEADLINE: " . ?→ )
2022-04-28 20:50:11 +00:00
( " SCHEDULED: " . ?↷ )
2022-05-01 14:24:57 +00:00
( " CLOSED: " . ?✓ ) )
2022-05-06 15:23:02 +00:00
;; electric-pair-pairs
;; (append electric-pair-pairs
;; (mapcar (lambda (emph)
;; (let ((ch (string-to-char (car emph))))
;; (cons ch ch)))
;; org-emphasis-alist))
2022-04-20 15:44:51 +00:00
;;+modeline-position-function #'+org-count-words-stupidly
)
2022-01-06 21:47:09 +00:00
( :local-hook user-save-hook #' +org-before-save@prettify-buffer )
2022-01-03 05:32:06 +00:00
( advice-add #' org-delete-backward-char :override #' +org-delete-backward-char )
2022-01-07 23:30:46 +00:00
;; (define-advice org-open-at-point (:around (fn &rest r) open-external)
;; "Open links from org externally."
;; (let ((browse-url-browser-function browse-url-secondary-browser-function))
;; (apply fn r)))
2022-04-20 15:44:51 +00:00
;; (add-to-list '+custom-variable-allowlist 'org-agenda-files)
2022-01-03 05:32:06 +00:00
( with-eval-after-load 'org
2022-01-18 16:30:02 +00:00
( setf ( alist-get " \\ .x?html? \\ ' " org-file-apps nil nil #' equal )
#' +org-open-html )
2022-01-03 05:32:06 +00:00
( org-clock-persistence-insinuate )
2022-01-19 00:16:01 +00:00
( org-link-set-parameters " tel " :follow #' +org-tel-open )
2022-02-07 04:16:51 +00:00
( org-link-set-parameters " sms " :follow #' +org-sms-open )
2022-01-19 00:16:01 +00:00
( setf ( alist-get " \\ .x?html? \\ ' " org-file-apps nil nil #' equal )
#' +org-open-html ) )
2022-05-06 15:23:02 +00:00
( :face 'org-done ' ( ( t ( :inherit ( modus-themes-subtle-green ) ) ) )
'org-tag ' ( ( t ( :inherit ( secondary-selection ) ) ) )
'org-todo ' ( ( t ( :inherit ( modus-themes-subtle-red ) ) ) ) )
2022-01-10 02:52:07 +00:00
;; Extra keywords
2022-01-04 20:41:46 +00:00
( font-lock-add-keywords
'org-mode
2022-01-10 02:52:07 +00:00
' ( ;; Fancy list bullets
2022-02-17 05:16:50 +00:00
;; NOTE: these `progn' and `default's are necessary; otherwise Emacs
;; complains about "Invalid face reference: t" in org-mode buffers, because
;; `compose-region' returns t.
2022-04-12 18:18:41 +00:00
( " ^[ \t ]* \\ ([-] \\ ) "
2022-04-13 15:15:59 +00:00
( 0 ;; (progn (compose-region (match-beginning 1) (match-end 1) "– ") 'fixed-pitch)
2022-04-20 03:24:44 +00:00
'fixed-pitch t ) )
2022-04-12 18:18:41 +00:00
( " ^[ \t ]* \\ ([+] \\ ) "
2022-04-13 15:15:59 +00:00
( 0 ;; (progn (compose-region (match-beginning 1) (match-end 1) "¬") 'fixed-pitch)
2022-04-20 03:24:44 +00:00
'fixed-pitch t ) )
2022-04-12 18:18:41 +00:00
( " ^[ \t ]+ \\ ([*] \\ ) "
2022-04-13 15:15:59 +00:00
( 0 ;; (progn (compose-region (match-beginning 1) (match-end 1) "→") 'fixed-pitch)
2022-04-20 03:24:44 +00:00
'fixed-pitch t ) )
2022-04-12 18:18:41 +00:00
;; Fancy numbered lists (well, monospaced)
2022-04-20 15:44:51 +00:00
( " ^[ \t ]* \\ ( \\ (?:[0-9]+ \\ |[A-Za-z] \\ )[.)] \\ ) " 0 'fixed-pitch t )
;; Make leading org-heading stars fixed-pitch
( " ^ \* + " 0 'fixed-pitch t )
) )
2022-01-19 00:16:01 +00:00
( with-eval-after-load 'form-feed
;; Horizontal lines
( font-lock-add-keywords
'org-mode
2022-01-24 19:25:05 +00:00
' ( ( " ^-----+ " . form-feed--font-lock-face ) ) ) )
( put 'browse-url-browser-function 'safe-local-variable
( lambda ( val )
( eq ( function-get val 'browse-url-browser-kind :autoload )
'external ) ) ) )
2022-01-03 05:32:06 +00:00
2021-12-29 00:20:07 +00:00
( setup org-agenda
2022-01-03 21:18:50 +00:00
( :option org-agenda-skip-deadline-if-done t
org-agenda-skip-scheduled-if-done t
org-agenda-span 10
2022-04-20 15:44:51 +00:00
org-agenda-block-separator ?─
org-agenda-time-grid
' ( ( daily today require-timed )
( 800 1000 1200 1400 1600 1800 2000 )
" ┄┄┄┄┄ " " ┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄ " )
org-agenda-current-time-string
" ← now ───────────────────────────────────────────────── "
2022-01-03 21:18:50 +00:00
org-agenda-include-diary nil ; I use the org-diary features
org-agenda-todo-ignore-deadlines 'near
org-agenda-todo-ignore-scheduled 'future
org-agenda-include-deadlines t
org-deadline-warning-days 0
2022-01-04 14:30:38 +00:00
org-agenda-show-future-repeats 'next
org-agenda-window-setup 'current-window )
2022-04-20 15:44:51 +00:00
( unless after-init-time
( :option org-agenda-files ( list ( sync/ " org/ " ) ) ) )
2022-01-04 20:41:46 +00:00
( dolist ( var ' ( org-agenda-files
org-agenda-file-regexp
org-agenda-templates ) )
( add-to-list '+custom-variable-allowlist var ) )
2022-04-27 13:38:03 +00:00
( define-advice org-agenda-files ( :filter-return ( ret ) )
" Remove SyncThing's sync-conflict files from the org agenda. "
( seq-remove ( lambda ( f ) ( string-match-p " sync-conflict " f ) ) ret ) )
2022-01-03 21:18:50 +00:00
( :+leader " a " #' org-agenda " C-a " #' org-agenda )
2022-01-17 19:45:32 +00:00
( :hook #' hl-line-mode )
2022-04-27 13:38:03 +00:00
( :local-set truncate-lines t )
( add-hook 'org-agenda-after-show-hook #' org-narrow-to-subtree ) )
2021-12-18 00:30:22 +00:00
2022-02-17 05:17:01 +00:00
( setup org-attach
( :also-load +org-attach )
( :option org-attach-method 'lns )
2022-02-19 00:25:27 +00:00
( with-eval-after-load '+org-attach
( +org-attach-fix-args-mode +1 ) ) )
2022-02-17 05:17:01 +00:00
2022-01-03 05:32:06 +00:00
( setup org-capture
( :require +org-capture )
2022-01-03 21:18:50 +00:00
( :+leader " c " #' org-capture " C-c " #' org-capture )
( +org-capture-templates-setf " t " " Todo " )
( +org-capture-templates-setf " tt "
2022-01-03 21:38:30 +00:00
` ( " Today! " entry ( file " todo.org " )
2022-02-07 23:09:04 +00:00
, ( concat " * TODO %^{Title} \n "
" DEADLINE: %t \n "
" \n %? " ) ) )
2022-01-03 21:18:50 +00:00
( +org-capture-templates-setf " ts "
2022-01-03 21:38:30 +00:00
` ( " Someday... " entry ( file " todo.org " )
2022-02-07 23:09:04 +00:00
, ( concat " * TODO %^{Title} \n "
" :PROPERTIES: \n "
" :CREATED: [%<%F %T>] \n "
" :END: \n "
" \n %? " ) ) )
2022-01-31 06:54:05 +00:00
( +org-capture-templates-setf " tm "
` ( " Media " entry ( file " todo.org " )
2022-02-07 23:09:04 +00:00
, ( concat " * TODO %^{TITLE} \n "
" :PROPERTIES: \n "
" :TITLE: % \\ 1 \n "
" :AUTHOR: %^{AUTHOR} \n "
" :END: \n "
" \n %? " ) ) )
2022-01-07 23:30:46 +00:00
( +org-capture-templates-setf " l "
` ( " Link " entry ( file " links.org " )
2022-02-07 23:09:04 +00:00
" * %(+org-insert-link-dwim) %^g \n \n " ) )
2022-01-25 22:57:56 +00:00
( +org-capture-templates-setf " w " " Work " )
( +org-capture-templates-setf " j "
' ( " Journal entry " plain
( file+olp+datetree " journal.org " )
2022-02-17 05:17:13 +00:00
" **** %U \n %i \n %? " ) )
2022-01-25 22:57:56 +00:00
;; TODO: Prompt for identity file from ~/.ssh and try to guess the hostname
;; from there.
( +org-capture-templates-setf " s "
` ( " SSH Config " plain ( file " ~/.ssh/config " )
2022-02-07 23:09:04 +00:00
, ( concat " \n \n Host %^{Host: } "
" \n Hostname % \\ 1 "
" \n User %^{User:| " ( user-login-name ) " } "
" \n IdentityFile %? "
" \n IdentitiesOnly yes "
" \n PubkeyAuthentication yes "
" \n Port %^{Port: |22} " )
:unnarrowed t ) )
2022-01-03 21:18:50 +00:00
( +org-capture-sort ) )
2022-04-24 20:01:58 +00:00
( setup org-id
( :load-after org )
;; https://helpdeskheadesk.net/2022-03-13/
( :option org-id-method 'ts
org-attach-id-to-path-function-list ' ( org-attach-id-ts-folder-format
org-attach-id-uuid-folder-format ) ) )
( setup ox ; org-export
2022-04-24 22:00:36 +00:00
( :also-load +ox
ox-md )
2022-01-14 00:01:12 +00:00
( :option org-export-coding-system 'utf-8-unix
org-export-headline-levels 8
2022-04-13 15:15:59 +00:00
org-export-with-drawers nil
2022-01-14 00:01:12 +00:00
org-export-with-section-numbers nil
org-export-with-smart-quotes t
org-export-with-sub-superscripts t
org-export-with-toc nil )
2022-04-24 22:00:36 +00:00
( with-eval-after-load 'ox
( +org-export-pre-hooks-insinuate ) )
( add-hook '+org-export-pre-hook #' +flyspell-correct-buffer )
2022-01-14 00:01:12 +00:00
( with-eval-after-load 'user-save
2022-04-24 22:00:36 +00:00
( add-hook '+org-export-pre-hook #' user-save-run-hooks ) ) )
2022-03-30 23:14:56 +00:00
2022-01-17 05:13:11 +00:00
( setup password-cache
( :option password-cache t
password-cache-expiry ( * 60 60 ) ) )
2022-04-20 15:44:51 +00:00
( setup prettify-symbols-mode
( :option prettify-symbols-unprettify-at-point t ) )
2021-12-05 05:09:33 +00:00
( setup prog
( :local-set comment-auto-fill-only-comments t )
2022-04-12 18:17:30 +00:00
( :hook #' prettify-symbols-mode ) )
2021-12-05 05:09:33 +00:00
2021-12-18 00:31:24 +00:00
( setup scratch
( :require +scratch )
2022-01-25 22:58:04 +00:00
( :option initial-major-mode #' lisp-interaction-mode
2022-04-27 13:38:03 +00:00
initial-scratch-message ( +scratch-fortune ) )
2021-12-29 00:20:07 +00:00
( add-hook 'kill-buffer-query-functions #' +scratch-immortal ) )
2021-12-18 00:31:24 +00:00
2022-01-07 23:30:46 +00:00
( setup shr
2022-04-13 03:40:37 +00:00
( :also-load +shr )
2022-01-07 23:30:46 +00:00
( :option shr-width ( - fill-column 5 ) ; pad out for wide letters
2022-04-13 03:40:37 +00:00
shr-use-fonts t )
( dolist ( mode ' ( eww-mode
elfeed-show-mode ) )
( add-hook ( intern ( format " %s-hook " mode ) ) #' +shr-heading-setup-imenu ) ) )
2022-01-07 23:30:46 +00:00
2022-01-11 22:01:03 +00:00
( setup tab-bar
( :require +tab-bar )
2022-01-14 00:01:12 +00:00
( :option tab-bar-tab-name-function '+tab-bar-basename
2022-01-11 22:01:03 +00:00
tab-bar-tab-name-truncated-max 20
2022-01-12 04:28:32 +00:00
tab-bar-tab-name-ellipsis truncate-string-ellipsis
2022-01-21 15:28:52 +00:00
tab-bar-show t
tab-bar-close-button-show t
2022-04-12 18:18:48 +00:00
tab-bar-new-button-show t
2022-03-30 23:14:56 +00:00
+tab-bar-menu-bar-icon " ; "
2022-04-12 18:18:48 +00:00
tab-bar-close-button ( propertize " × "
2022-01-31 06:53:58 +00:00
'display t
2022-04-12 18:18:48 +00:00
'close-tab nil )
2022-01-21 15:28:52 +00:00
tab-bar-new-button ( propertize " + " 'display t ) )
2022-02-07 04:17:56 +00:00
;; I need to set these here so that they take effect /before/ `display-time-mode'
( :option display-time-format " %H:%M "
display-time-mail-file :disable
display-time-load-average-threshold 50 )
2022-03-30 23:14:56 +00:00
( :option tab-bar-format ' ( ;;+tab-bar-format-menu-bar
2022-02-07 04:17:56 +00:00
tab-bar-format-history
tab-bar-format-tabs
tab-bar-separator
tab-bar-format-add-tab
2022-04-20 15:44:51 +00:00
+tab-bar-format-align-right
2022-02-07 04:17:56 +00:00
;;+tab-bar-misc-info
2022-02-17 05:19:16 +00:00
+tab-bar-org-clock
2022-02-07 19:16:00 +00:00
+tab-bar-bongo
2022-02-08 20:16:28 +00:00
;;+tab-bar-emms
2022-02-07 04:17:56 +00:00
+tab-bar-tracking-mode
2022-02-17 05:19:16 +00:00
+tab-bar-notmuch-count
2022-02-07 04:17:56 +00:00
+tab-bar-date ) )
2022-01-11 22:01:03 +00:00
( tab-bar-mode +1 )
2022-02-07 04:17:56 +00:00
( display-time-mode +1 ) )
2022-01-11 22:01:03 +00:00
2022-02-28 15:39:12 +00:00
( setup timer-list
2022-04-12 18:18:55 +00:00
( :bind " d " #' timer-list-cancel )
2022-02-28 15:39:12 +00:00
( :hook #' hl-line-mode
#' lin-mode ) )
2022-01-18 23:18:06 +00:00
( setup tramp
( el-patch-feature tramp )
( with-eval-after-load 'tramp
( el-patch-defun tramp-debug-buffer-command-completion-p ( _symbol buffer )
" A predicate for Tramp interactive commands.
2022-05-01 14:24:44 +00:00
They are completed by \"M-x TAB\" only in Tramp debug buffers. "
2022-01-18 23:18:06 +00:00
( with-current-buffer buffer
( el-patch-wrap 2
2022-02-07 23:09:04 +00:00
( save-restriction
( widen )
( string-equal ( buffer-substring 1 10 ) " ;; Emacs: " ) ) ) ) ) ) )
2022-01-18 23:18:06 +00:00
2021-11-22 05:57:41 +00:00
( setup ( :straight 0x0 )
( :option 0x0-default-server 'ttm )
( with-eval-after-load 'embark
2021-12-30 04:55:55 +00:00
( define-key embark-region-map ( kbd " U " ) #' 0x0-dwim ) ) )
2021-11-22 05:57:41 +00:00
2021-12-18 00:29:58 +00:00
( setup ( :straight ace-window )
2021-12-18 20:34:28 +00:00
( :require +ace-window )
2021-12-18 00:29:58 +00:00
( :option aw-keys ' ( ?a ?s ?d ?f ?g ?h ?j ?k ?l )
2022-01-07 23:30:46 +00:00
aw-display-mode-overlay nil
2022-04-20 15:44:51 +00:00
aw-scope 'frame
aw-minibuffer-flag t )
2021-12-29 00:20:07 +00:00
( :+key " M-o " #' +ace-window-or-switch-buffer )
2022-04-20 15:44:51 +00:00
( :face 'aw-mode-line-face ' ( ( t ( :foreground " red " ) ) ) )
2021-12-18 00:29:58 +00:00
( +ace-window-display-mode +1 ) )
2021-12-30 18:27:55 +00:00
( setup ( :straight ( actually-selected-window
:host github
:repo " duckwork/actually-selected-window.el " ) )
( actually-selected-window-mode +1 ) )
2022-01-05 05:57:39 +00:00
( setup ( :straight adaptive-wrap )
( :with-mode adaptive-wrap-prefix-mode
( :hook-into visual-column-mode ) ) )
2022-04-20 03:27:03 +00:00
( setup ( :straight affe
2022-02-07 04:17:56 +00:00
( or ( executable-find " rg " )
( and ( executable-find " find " )
( executable-find " grep " ) ) ) )
( :load-after consult orderless vertico )
2022-04-02 18:55:59 +00:00
( setq affe-regexp-compiler ( defun affe-orderless-regexp-compiler ( input &rest _ )
2022-02-07 04:17:56 +00:00
( setq input ( orderless-pattern-compiler input ) )
( cons input ( lambda ( str ) ( orderless--highlight input str ) ) ) ) )
2022-03-30 23:14:56 +00:00
( +with-eval-after-loads ( affe vertico-multiform )
2022-04-02 18:55:59 +00:00
( setq affe-regexp-compiler ( defun affe-orderless-regexp-compiler ( input &rest _ )
2022-03-30 23:16:40 +00:00
( setq input ( orderless-pattern-compiler input ) )
( cons input ( lambda ( str ) ( orderless--highlight input str ) ) ) ) )
2022-04-27 13:38:03 +00:00
( setf ( alist-get 'affe-grep vertico-multiform-commands ) nil
( alist-get 'affe-find vertico-multiform-commands ) nil )
2022-02-17 05:19:16 +00:00
( :+key " M-s g " #' affe-grep
" M-s f " #' affe-find ) ) )
2022-02-07 04:17:56 +00:00
2022-01-31 23:26:39 +00:00
( setup ( :straight alert )
( :option alert-default-style 'libnotify ) )
2021-11-22 05:57:41 +00:00
( setup ( :straight anzu )
2021-12-05 05:09:33 +00:00
( :option anzu-cons-mode-line-p nil )
2021-12-29 00:20:07 +00:00
( :+key [ remap query-replace ] #' anzu-query-replace-regexp
[ remap query-replace-regexp ] #' anzu-query-replace-regexp )
2021-11-22 05:57:41 +00:00
( global-anzu-mode +1 )
( :bind-into isearch
2021-12-29 00:20:07 +00:00
[ remap isearch-query-replace ] #' anzu-isearch-query-replace
[ remap isearch-query-replace-regexp ] #' anzu-isearch-query-replace-regexp ) )
2021-09-16 04:32:16 +00:00
( setup ( :straight avy )
2022-01-05 23:12:32 +00:00
( :require avy +avy )
2022-01-14 00:01:12 +00:00
( :option avy-background t
avy-lead-faces
' ( avy-lead-face
avy-lead-face-1 avy-lead-face-1 avy-lead-face-1
avy-lead-face-1 avy-lead-face-1 avy-lead-face-1 ) )
2022-04-20 15:44:51 +00:00
( :face 'avy-background-face
' ( ( t ( :foreground " #888888 " ) ) ) )
2021-12-29 00:20:07 +00:00
( :+key " M-j " #' avy-goto-char-timer )
2021-11-22 05:57:41 +00:00
( :bind-into isearch
2021-12-29 00:20:07 +00:00
" M-j " #' avy-isearch )
2021-11-22 05:57:41 +00:00
( :when-loaded
2021-12-29 00:20:07 +00:00
( setf ( alist-get ?. avy-dispatch-alist ) #' avy-action-embark ) ) )
2021-09-16 04:32:16 +00:00
2022-03-12 02:04:05 +00:00
( setup ( :straight bbdb )
2022-04-20 03:27:03 +00:00
( :straight bbdb-vcard )
2022-03-12 02:04:05 +00:00
( :require bbdb-autoloads
bbdb )
( bbdb-initialize 'gnus 'message ) )
2022-02-07 19:16:09 +00:00
( setup ( :straight ( bongo :type git
:flavor melpa
:files ( " *.el " " *.texi " " images " " *.rb " " bongo-pkg.el " " *.info " )
:pre-build ( " makeinfo " " --no-split " " bongo.texi " )
:host github
:repo " dbrock/bongo " ) )
( :also-load +bongo )
2022-02-07 23:09:32 +00:00
( :option bongo-default-directory " ~/var/music "
bongo-custom-backend-matchers ' ( ( mpv . ( ( " https: " ) . t ) ) )
+bongo-radio-stations ; use `+bongo-radio' for these
` ( ;; Local radio
( " KLSU "
. " http://130.39.238.143:8010/stream.mp3 " )
( " WRKF: NPR for the Capital Region "
. , ( concat " https://playerservices.streamtheworld.com/api/ "
" livestream-redirect/WRKFFM.mp3 " ) )
( " WRKF HD-2 "
. , ( concat " https://playerservices.streamtheworld.com/api/ "
" livestream-redirect/WRKFHD2.mp3 " ) )
( " WBRH: Jazz & More "
. " http://wbrh.streamguys1.com/wbrh-mp3 " )
( " KBRH Blues & Rhythm Hits "
. " http://wbrh.streamguys1.com/kbrh-mp3 " )
;; Soma FM
( " Soma FM Synphaera "
. " https://somafm.com/synphaera256.pls " )
( " SomaFM BAGel Radio "
. " https://somafm.com/bagel.pls " )
( " SomaFM Boot Liquor "
. " https://somafm.com/bootliquor320.pls " )
( " SomaFM Deep Space One "
. " https://somafm.com/deepspaceone.pls " )
( " SomaFM Fluid "
. " https://somafm.com/fluid.pls " )
( " SomaFM Underground 80s "
. " https://somafm.com/u80s256.pls " )
;; Tildeverse & Friends
( " tilderadio "
. " https://azuracast.tilderadio.org/radio/8000/radio.ogg " )
( " vantaradio "
. " https://vantaa.black/radio " )
;; Other online radio
( " BadRadio: 24/7 PHONK "
. " https://s2.radio.co/s2b2b68744/listen " )
( " Cafe - lainon.life "
. " https://lainon.life/radio/cafe.ogg.m3u " )
( " Everything - lainon.life "
. " https://lainon.life/radio/everything.ogg.m3u " )
( " Swing - lainon.life "
. " https://lainon.life/radio/swing.ogg.m3u " )
( " Cyberia - lainon.life "
. " https://lainon.life/radio/cyberia.ogg.m3u " )
( " Nightwave Plaza - Online Vaporwave Radio "
. " http://radio.plaza.one/opus " ) ) )
( advice-add 'bongo-play :before #' +bongo-stop-all )
2022-02-07 19:16:09 +00:00
( with-eval-after-load 'notifications
( add-hook 'bongo-player-metadata-changed-hook #' +bongo-notify ) ) )
2022-04-27 13:38:03 +00:00
( setup ( :straight browse-kill-ring )
( :+key " C-M-y " #' browse-kill-ring )
( :option browse-kill-ring-highlight-current-entry t
browse-kill-ring-highlight-inserted-item 'pulse
browse-kill-ring-separator " " )
( :hook #' form-feed-mode ) )
2021-12-31 03:14:06 +00:00
( setup ( :straight ( cape
:host github :repo " minad/cape " ) )
( dolist ( fn
2022-02-07 23:09:32 +00:00
;; All available cape capfs listed here. Add them to the front since
;; they're reversed with `add-to-list'.
' ( cape-file
cape-dabbrev
cape-keyword
2022-03-30 23:14:56 +00:00
;;cape-abbrev
2022-02-07 23:09:32 +00:00
cape-ispell
;;cape-dict
) )
2022-02-08 20:16:28 +00:00
( add-to-list 'completion-at-point-functions fn :append ) ) )
2021-11-23 05:07:32 +00:00
2021-09-25 19:03:00 +00:00
( setup ( :straight circe )
2021-12-13 16:29:50 +00:00
( :require _circe
+circe )
2021-12-18 00:31:24 +00:00
( :also-load circe-chanop )
2022-01-06 21:49:01 +00:00
( +ensure-after-init ( lambda ( ) ( defalias 'irc '+irc " Start IRC. " ) ) )
2021-10-22 00:00:43 +00:00
2021-11-22 05:57:41 +00:00
;; Formatting options
2022-01-03 23:05:03 +00:00
( :option
;; Messages between users
circe-format-action ( format ( format " %%%ds* {nick} {body} "
( - +circe-left-margin 2 ) )
" " )
circe-format-say ( format " {nick:%1$d.%1$ds} | {body} "
( - +circe-left-margin 3 ) )
circe-format-self-action circe-format-action
circe-format-self-say ( replace-regexp-in-string " | " " > " circe-format-say )
circe-format-notice ( format " -{nick:%1$d.%1$ds}---{body} "
( - +circe-left-margin 4 ) )
circe-format-message ( format ( format " %%%ds@ *{nick}* {body} "
( - +circe-left-margin 2 ) )
" " )
circe-format-message-action ( replace-regexp-in-string " @ " " * "
circe-format-message )
circe-format-self-message ( format ( format " %%%ds> *{chattarget}* {body} "
( - +circe-left-margin 2 ) )
" " )
;; Meta messages
circe-format-server-channel-creation-time ( +circe-format-meta
( concat " Channel {channel} "
" created on {date} " ) t )
circe-format-server-ctcp ( +circe-format-meta
( concat " CTCP PING request to {target} from "
" {userhost}: {body} " ) )
circe-format-server-ctcp-ping-reply ( +circe-format-meta
( concat
" CTCP PING reply to {target} from "
" {userhost}: {body} " ) )
circe-format-server-part ( +circe-format-meta " PART {channel}: {reason} " )
circe-format-server-quit ( +circe-format-meta " QUIT: {reason} " )
circe-format-server-quit-channel ( +circe-format-meta
" QUIT {channel}: {reason} " )
circe-format-server-join ( +circe-format-meta " JOIN: {userinfo} " )
circe-format-server-join-in-channel ( +circe-format-meta
" JOIN {channel}: {userinfo} " )
circe-format-server-lurker-activity ( +circe-format-meta
" (JOINED {joindelta} ago) " )
circe-format-server-message ( +circe-format-meta " {body} " t )
circe-fromat-server-mode-change ( +circe-format-meta
( concat " MODE: {target} {change} "
" by {setter} ({userhost}) " ) t )
circe-format-server-netmerge ( +circe-format-meta
( concat " NETMERGE: {split} at {date} "
" (/WL to see who's still missing) " ) t )
circe-format-server-netsplit ( +circe-format-meta
( concat " NETSPLIT: {split} "
" (/WL to see who left) " ) t )
circe-format-server-nick-change ( +circe-format-meta
" NICK WAS {old-nick} ({userhost}) "
" new-nick " )
circe-format-server-nick-regain ( +circe-format-meta
" NICK REGAINED: {old-nick} ({userhost}) "
" new-nick " )
circe-format-server-notice ( +circe-format-meta " -SERVER NOTICE- {body} " t )
circe-format-server-topic-time ( +circe-format-meta
" TOPIC SET BY {setter} on {topic-date} " )
circe-format-server-topic-time-for-channel ( +circe-format-meta
( concat
" TOPIC ({channel}) SET BY "
" {setter} on {topic-date} " ) )
circe-format-server-whois-idle ( +circe-format-meta " IDLE FOR {idle-duration} "
" whois-nick " )
circe-format-server-whois-idle-with-signon ( +circe-format-meta
( concat
" IDLE FOR {idle-duration} "
" (signon: {signon-date}) " )
" whois-nick " )
circe-format-server-rejoin ( +circe-format-meta
( concat " REJOIN: {userinfo} "
" after {departuredelta} " ) )
circe-format-server-topic ( +circe-format-meta " TOPIC: {new-topic} " )
circe-prompt-string ( format ( format " %%%ds> "
( - +circe-left-margin 2 ) )
" " ) )
2021-12-30 04:55:55 +00:00
2021-11-23 05:08:46 +00:00
( :option +circe-server-buffer-action ( lambda ( buf )
( message " Connected to %s " buf ) )
+circe-network-inhibit-autoconnect _circe-network-inhibit-autoconnect
2021-11-22 05:57:41 +00:00
circe-network-options _circe-network-options
circe-color-nicks-everywhere t
circe-default-part-message " See You, Space Cowpokes . . . "
circe-default-user user-real-login-name
2021-09-25 19:03:00 +00:00
circe-reduce-lurker-spam t
2021-11-22 05:57:41 +00:00
circe-server-auto-join-default-type :after-auth )
2021-12-29 00:20:07 +00:00
( :bind " C-c C-p " #' circe-command-PART
" C-c C-t " #' +circe-current-topic
" C-l " #' lui-track-jump-to-indicator
" C-<return> " #' +circe-chat@set-prompt )
2022-01-24 19:23:47 +00:00
;; XXX: this doesn't quite work right.
2021-12-29 00:20:07 +00:00
( advice-add #' circe-command-PART :after #' +circe-kill-buffer )
( advice-add #' circe-command-QUIT :after #' +circe-quit@kill-buffer )
( advice-add #' circe-command-GQUIT :after #' +circe-gquit@kill-buffer )
2021-12-30 04:55:55 +00:00
2021-09-25 19:03:00 +00:00
( :with-mode circe-chat-mode
2022-01-10 02:52:07 +00:00
( :local-set lui-input-function #' +lui-filter )
2021-12-29 00:20:07 +00:00
( :hook #' enable-circe-color-nicks
#' enable-circe-new-day-notifier
2022-01-10 02:52:07 +00:00
#' +circe-chat@set-prompt
;; Filters
2022-02-17 05:19:16 +00:00
;;#'+circe-F/C-mode
2022-01-10 02:52:07 +00:00
;; For some reason `+circe-shorten-url-mode' won't work right out of
;; the gate.
2022-02-17 05:19:16 +00:00
;;(lambda () (run-at-time 0.25 nil #'+circe-shorten-url-mode))
)
2021-12-29 00:20:07 +00:00
( :bind " C-c C-s " #' circe-command-SLAP ) )
2021-09-25 19:03:00 +00:00
( :with-mode lui-mode
2021-11-22 05:57:41 +00:00
( :option lui-fill-column ( + fill-column +circe-left-margin )
lui-fill-type nil
2021-09-25 19:03:00 +00:00
lui-time-stamp-position 'right-margin
2022-02-17 05:19:16 +00:00
lui-time-stamp-format " | %H:%M "
2021-09-25 19:03:00 +00:00
lui-track-behavior 'before-switch-to-buffer
2022-01-05 05:57:39 +00:00
lui-track-indicator 'bar
2021-12-18 20:33:49 +00:00
lui-fill-remove-face-from-newline nil
lui-formatting-list ` ( ( , ( +lui-make-formatting-list-rx " * " )
2022-02-07 23:09:04 +00:00
1 lui-strong-face )
2021-12-18 20:33:49 +00:00
( , ( +lui-make-formatting-list-rx " _ " )
2022-02-07 23:09:04 +00:00
1 lui-emphasis-face )
2021-12-18 20:33:49 +00:00
( , ( +lui-make-formatting-list-rx " / " )
2022-02-07 23:09:04 +00:00
1 lui-emphasis-face ) )
2022-01-14 00:01:12 +00:00
lui-autopaste-function
( defun +0x0-upload-string ( string )
" Upload a string using 0x0. "
( with-temp-buffer
( insert string )
( 0x0-upload-text ( 0x0--choose-server ) ) )
2022-02-07 04:17:56 +00:00
( current-kill 0 ) ) )
2022-01-03 21:17:33 +00:00
( add-to-list '+pulse-location-commands #' lui-track-jump-to-indicator )
2022-04-20 15:44:51 +00:00
( :face 'lui-track-bar ' ( ( t ( :height 10
:underline ( :color foreground-color
:style line
:position line )
:extend t :inhert ( default ) ) ) ) )
2021-12-29 00:20:07 +00:00
( :hook #' visual-line-mode
#' enable-lui-track
2022-01-06 21:49:01 +00:00
#' visual-fill-column-mode
2022-01-14 00:01:12 +00:00
#' enable-lui-autopaste )
2021-11-22 05:57:41 +00:00
( :local-set fringes-outside-margins t
right-margin-width ( length lui-time-stamp-format )
2021-09-25 19:03:00 +00:00
scroll-margin 0
2022-01-11 22:01:03 +00:00
scroll-step 1
2021-09-25 19:03:00 +00:00
word-wrap t
2021-11-22 05:57:41 +00:00
wrap-prefix ( +string-repeat +circe-left-margin " " )
2021-09-27 23:19:47 +00:00
line-number-mode nil
2021-09-29 22:21:01 +00:00
column-number-mode nil
2021-11-22 05:57:41 +00:00
file-percentage-mode nil
visual-fill-column-extra-text-width
2022-01-11 22:01:03 +00:00
( cons +circe-left-margin 0 ) )
( with-eval-after-load 'vertico-multiform
( setf ( alist-get 'lui-next-button-or-complete vertico-multiform-commands )
' ( flat ) ) ) )
2022-05-06 15:23:02 +00:00
( tracking-mode +1 )
2022-01-11 22:01:03 +00:00
( :with-mode tracking-mode
( :option tracking-position 'before-modes )
2022-03-30 23:14:56 +00:00
( :bind " C-c C-SPC " ( lambda ( ) ( interactive )
2022-04-28 20:49:42 +00:00
( if ( and +tracking-hide-when-org-clocking
( fboundp 'org-clocking-p )
2022-03-30 23:14:56 +00:00
( org-clocking-p ) )
( message " Bro, get back to work! " )
( call-interactively #' tracking-next-buffer ) ) ) )
2022-01-11 22:01:03 +00:00
( add-to-list 'mode-line-misc-info
' ( tracking-mode
tracking-mode-line-buffers ) ) )
2021-10-15 01:34:46 +00:00
2021-12-20 04:11:39 +00:00
( with-eval-after-load 'topsy
( :option ( append topsy-mode-functions )
' ( circe-channel-mode . +circe-current-topic ) ) )
2021-12-26 19:05:05 +00:00
( with-eval-after-load 'circe-color-nicks
2021-12-29 00:20:07 +00:00
( add-hook 'modus-themes-after-load-theme-hook #' circe-nick-color-reset ) )
( add-hook 'kill-emacs-hook #' +circe-quit-all@kill-emacs ) )
2021-09-25 19:03:00 +00:00
2022-02-28 15:39:24 +00:00
( setup ( :straight ( clean-kill-ring
:host github
:repo " NicholasBHubbard/clean-kill-ring.el " ) )
( :require )
( :option clean-kill-ring-prevent-duplicates t )
( clean-kill-ring-mode +1 ) )
2022-01-17 05:13:11 +00:00
( setup ( :straight clhs ) )
2021-11-22 05:57:41 +00:00
( setup ( :straight consult )
2022-03-30 23:14:56 +00:00
( :require consult +consult )
2021-11-22 05:57:41 +00:00
;; from Consult wiki
2021-09-16 04:32:16 +00:00
( :option register-preview-delay 0
2022-01-07 04:55:26 +00:00
register-preview-function #' consult-register-format
xref-show-xrefs-function #' consult-xref
xref-show-definitions-function #' consult-xref
2022-01-03 16:37:03 +00:00
tab-always-indent 'complete
2022-01-07 04:55:26 +00:00
completion-in-region-function #' consult-completion-in-region )
2021-12-29 00:20:07 +00:00
( advice-add #' register-preview :override #' consult-register-window )
( advice-add #' completing-read-multiple :override
2022-01-03 16:37:03 +00:00
#' consult-completing-read-multiple )
2021-11-22 05:57:41 +00:00
( dolist ( binding ' ( ;; C-c bindings (mode-specific-map)
2022-01-03 16:37:03 +00:00
( " C-c h " . consult-history )
( " C-c m " . consult-mode-command )
( " C-c b " . consult-bookmark )
( " C-c k " . consult-kmacro )
;; C-x bindings (ctl-x-map)
( " C-x M-: " . consult-complex-command )
2022-05-01 14:25:12 +00:00
( " <f2> " . consult-buffer )
2022-01-03 16:37:03 +00:00
( " C-x b " . consult-buffer )
( " C-x 4 b " . consult-buffer-other-window )
( " C-x 5 b " . consult-buffer-other-frame )
;; Custom M-# bindings for fast register access
( " M-# " . consult-register-load )
( " M-' " . consult-register-store )
( " C-M-# " . consult-register )
;; Other custom bindings
( " M-y " . consult-yank-pop )
2022-02-19 00:25:27 +00:00
;;("<f1> a" . consult-apropos)
2022-01-03 16:37:03 +00:00
;; M-g bindings (goto-map)
( " M-g e " . consult-compile-error )
( " M-g f " . consult-flymake ) ; or consult-flycheck
( " M-g g " . consult-goto-line )
( " M-g M-g " . consult-goto-line )
( " M-g o " . consult-outline ) ; or consult-org-heading
( " M-g m " . consult-mark )
( " M-g k " . consult-global-mark )
( " M-g i " . consult-imenu )
2022-05-01 14:25:12 +00:00
( " M-g M-i " . consult-imenu )
2022-01-03 16:37:03 +00:00
( " M-g I " . consult-imenu-multi )
;; M-s bindings (search-map)
( " M-s f " . consult-find )
( " M-s F " . consult-locate )
( " M-s g " . consult-grep )
( " M-s G " . consult-git-grep )
( " M-s r " . consult-ripgrep )
( " M-s l " . consult-line )
( " M-s L " . consult-line-multi )
( " M-s m " . consult-multi-occur )
( " M-s k " . consult-keep-lines )
( " M-s u " . consult-focus-lines )
;; Isearch integration
( " M-s e " . consult-isearch-history ) ) )
2022-01-05 23:12:32 +00:00
( global-set-key ( kbd ( car binding ) ) ( cdr binding ) ) )
2021-11-22 05:57:41 +00:00
( with-eval-after-load 'isearch-mode
( dolist ( binding ' ( ( " M-e " . consult-isearch-history )
2022-01-03 16:37:03 +00:00
( " M-s e " . consult-isearch-history )
( " M-s l " . consult-line )
( " M-s L " . consult-line-multi ) ) )
2021-11-22 05:57:41 +00:00
( define-key isearch-mode-map ( car binding ) ( cdr binding ) ) ) )
2022-01-17 05:31:07 +00:00
( :+menu " b " #' consult-buffer
" f " #' find-file )
2022-02-19 00:25:27 +00:00
( :bind-into org
" M-g o " #' consult-org-heading )
( advice-add 'consult-yank-pop :after #' +yank@indent )
2022-02-07 04:17:56 +00:00
( :when-loaded
2021-11-22 05:57:41 +00:00
( :option consult-narrow-key " < "
2022-01-03 16:37:03 +00:00
consult-project-root-function '+consult-project-root )
2022-02-07 04:17:56 +00:00
( consult-customize consult-theme
:preview-key ' ( :debounce 0.2 any ) )
( consult-customize consult-ripgrep consult-git-grep consult-grep
consult-bookmark consult-recent-file consult-xref
2022-02-17 05:19:16 +00:00
consult--source-recent-file
consult--source-project-recent-file
2022-02-07 04:17:56 +00:00
consult--source-bookmark consult-buffer
:preview-key ( kbd " M-, " ) )
2021-11-22 05:57:41 +00:00
( consult-history-to-modes ( ( minibuffer-local-map . nil )
( shell-mode-map . shell-mode-hook )
( term-mode-map . term-mode-hook )
( term-raw-map . term-mode-hook )
( comint-mode-map . comint-mode-hook )
( sly-mrepl-mode-map . sly-mrepl-hook ) ) )
( with-eval-after-load 'orderless
2022-02-07 04:17:56 +00:00
( :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
2022-05-06 15:23:02 +00:00
consult-flymake
consult-focus-lines
2022-02-07 04:17:56 +00:00
consult-git-grep
2022-05-06 15:23:02 +00:00
consult-grep
consult-imenu
consult-imenu-multi
consult-keep-lines
2022-02-07 04:17:56 +00:00
consult-line
consult-line-multi
2022-05-06 15:23:02 +00:00
consult-locate
2022-02-07 04:17:56 +00:00
consult-multi-occur
2022-05-06 15:23:02 +00:00
consult-outline
consult-ripgrep
consult-yank-pop ) )
2022-04-27 13:38:03 +00:00
( setf ( alist-get buf-cmd vertico-multiform-commands ) nil ) ) ) ) )
2021-09-16 04:32:16 +00:00
2022-01-07 04:55:26 +00:00
( setup ( :straight consult-dir )
( :+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 ) ) )
2022-02-09 02:59:02 +00:00
( setup ( :straight consult-notmuch )
( :load-after consult notmuch )
( with-eval-after-load 'vertico-multiform
2022-04-27 13:38:03 +00:00
( setf ( alist-get 'consult-notmuch vertico-multiform-commands ) nil
( alist-get 'consult-notmuch-tree vertico-multiform-commands ) nil ) ) )
2022-02-09 02:59:02 +00:00
2022-04-20 03:27:03 +00:00
( setup ( :straight corfu
:quit " Turns out, I actually like minibuffer completion better. " )
2022-02-08 20:17:05 +00:00
( +with-ensure-after-init
( corfu-global-mode +1 ) ) )
2022-02-07 04:17:56 +00:00
( setup ( :straight crossword )
;; This isn't the perfect Emacs crossword puzzle, but it's the only one I
;; know.
( :hook #' turn-off-+key-mode )
( :option crossword-save-path ( sync/ " emacs/crosswords/ " t )
crossword-empty-position-char " = " )
2022-04-20 15:44:51 +00:00
( :face 'crossword-grid-face ' ( ( t :inherit 'font-lock-string-face ) )
'crossword-current-face ' ( ( t :inherit 'highlight ) )
'crossword-other-dir-face ' ( ( t :inherit 'font-lock-keyword-face ) ) ) )
2022-02-07 04:17:56 +00:00
2021-12-06 04:37:41 +00:00
( setup ( :straight crux )
2022-01-04 06:40:26 +00:00
;; yes it's silly I have an addon to this addon.
2022-01-28 23:24:53 +00:00
( :require crux +crux )
2022-01-05 23:12:32 +00:00
( :option crux-shell-func #' crux-eshell
2022-02-09 02:59:13 +00:00
crux-shell-buffer-name " eshell "
2022-01-05 23:12:32 +00:00
+crux-default-date-format " %F " )
2022-01-04 06:40:26 +00:00
( :global " C-o " #' crux-smart-open-line
" C-x 4 t " #' crux-transpose-windows
" M-w " #' +crux-kill-ring-save
2022-04-12 18:15:36 +00:00
" C-k " #' +crux-kill-and-join-forward
2022-01-04 06:40:26 +00:00
" C-c d " #' +crux-insert-date-or-time )
2022-01-25 22:58:22 +00:00
( crux-with-region-or-buffer indent-region )
2021-12-06 04:37:41 +00:00
( el-patch-feature crux )
( with-eval-after-load 'crux
( el-patch-defun crux-reopen-as-root ( )
" Find file as root if necessary.
2022-05-01 14:24:44 +00:00
Meant to be used as ` find-file-hook '.
See also ` crux-reopen-as-root-mode '. "
2021-12-06 04:37:41 +00:00
( unless ( or
;; This helps fix for `nov-mode', and possibly others.
( el-patch-add ( null buffer-file-name ) )
( tramp-tramp-file-p buffer-file-name )
( equal major-mode 'dired-mode )
( not ( file-exists-p ( file-name-directory buffer-file-name ) ) )
( file-writable-p buffer-file-name )
( crux-file-owned-by-user-p buffer-file-name ) )
( crux-find-alternate-file-as-root buffer-file-name ) ) ) )
( crux-reopen-as-root-mode +1 ) )
2022-04-12 18:19:16 +00:00
( setup ( :straight csv-mode ) )
2021-09-25 19:03:00 +00:00
( setup ( :straight dictionary )
( :option dictionary-use-single-buffer t )
( autoload 'dictionary-search " dictionary "
" Ask for a word and search it in all dictionaries " t )
2022-01-10 02:52:07 +00:00
( :hook #' reading-mode ) )
2021-09-16 04:32:16 +00:00
2022-02-19 00:25:07 +00:00
( setup ( :straight diff-hl )
( global-diff-hl-mode +1 ) )
2022-02-17 05:19:16 +00:00
( setup ( :straight dired-git-info )
( :bind-into dired
" ) " #' dired-git-info-mode ) )
( setup ( :straight dired-open )
( :load-after dired ) )
( setup ( :straight dired-subtree )
( :load-after dired )
( :bind-into dired
" TAB " #' dired-subtree-cycle
" i " #' dired-subtree-toggle ) )
2021-12-18 00:31:24 +00:00
( setup ( :straight ( discord
:host github
:repo " davep/discord.el "
:fork ( :repo " duckwork/discord.el " ) ) ) )
2022-01-10 05:58:04 +00:00
( setup ( :straight dumb-jump )
( add-hook 'xref-backend-functions #' dumb-jump-xref-activate ) )
2022-04-20 03:27:03 +00:00
( setup ( :straight ebuku
2022-01-28 23:24:20 +00:00
( executable-find " buku " ) )
( :option ebuku-display-on-startup 'recent
ebuku-recent-count 100 ) )
2022-02-07 04:17:56 +00:00
( setup ( :straight edit-server )
( :option edit-server-url-major-mode-alist ` ( ( " github \\ .com " . , ( if ( fboundp 'gfm-mode )
#' gfm-mode
#' markdown-mode ) ) ) )
( add-hook 'edit-server-done-hook ( lambda ( ) ( unfill-region ( point-min ) ( point-max ) ) ) )
( +with-ensure-after-init
( edit-server-start ) ) )
2021-11-22 05:57:41 +00:00
( setup ( :straight electric-cursor )
2022-01-07 04:54:56 +00:00
( :option electric-cursor-alist ' ( ( overwrite-mode . hbar )
2022-01-28 01:26:33 +00:00
( god-local-mode . box )
( t . bar ) ) )
2021-09-16 04:32:16 +00:00
( electric-cursor-mode +1 ) )
2021-12-18 00:31:24 +00:00
( setup ( :straight elfeed )
2022-01-18 23:18:06 +00:00
( :require +elfeed )
2022-01-04 04:37:34 +00:00
( +define-dir elfeed/ ( sync/ " emacs/elfeed/ " t ) )
( :option
elfeed-curl-program-name ( executable-find " curl " )
elfeed-use-curl elfeed-curl-program-name
elfeed-curl-extra-arguments ' ( " --insecure " )
elfeed-enclosure-default-dir ( cl-loop for dir in ' ( " ~/var/download/ "
" ~/Downloads/ " )
2022-02-07 23:09:04 +00:00
if ( file-exists-p dir )
return dir )
2022-01-04 04:37:34 +00:00
elfeed-search-filter " @1-month-ago +unread "
elfeed-search-trailing-width 24
elfeed-search-title-min-width 24
elfeed-search-title-max-width 78
2022-01-11 22:01:03 +00:00
elfeed-search-remain-on-entry t
2022-01-04 04:37:34 +00:00
elfeed-show-unique-buffers t
2022-01-12 04:28:32 +00:00
elfeed-db-directory ( elfeed/ " db/ " t ) )
2022-02-17 05:19:16 +00:00
( :+leader " f " #' elfeed " C-f " #' elfeed )
2022-01-14 23:20:23 +00:00
( advice-add #' elfeed-search-fetch :after #' beginning-of-buffer )
2022-01-04 23:26:37 +00:00
( :with-mode elfeed-search-mode
2022-03-12 02:04:05 +00:00
( :bind " & " #' +elfeed-search-browse-generic
" w " #' elfeed-search-yank
2022-03-30 23:14:56 +00:00
" y " nil
" a " #' +elfeed-show-mark-read-and-advance )
2022-01-04 23:26:37 +00:00
( :hook #' hl-line-mode )
;; https://old.reddit.com/r/emacs/comments/rlli0u/whats_your_favorite_defadvice/hphfh4e/
2022-01-10 02:52:07 +00:00
( advice-add #' elfeed-search-update--force :after #' elfeed-db-save )
( advice-add #' elfeed :before #' elfeed-db-load ) )
2021-12-18 00:31:24 +00:00
( :with-mode elfeed-show-mode
2021-12-29 00:20:07 +00:00
( :bind " SPC " #' +elfeed-scroll-up-command
2022-02-07 04:17:56 +00:00
" S-SPC " #' +elfeed-scroll-down-command
2022-01-12 04:28:32 +00:00
" & " #' +elfeed-show-browse-generic
2022-03-12 02:04:05 +00:00
" RET " #' shr-browse-url
" w " #' elfeed-show-yank
" y " nil )
2022-01-04 04:37:34 +00:00
( :hook #' reading-mode )
2022-02-08 20:16:28 +00:00
( :option +elfeed--update-repeat ( * 60 30 ) ; 1/2 hour
2022-02-17 05:19:16 +00:00
+elfeed--update-first-time 60 ) )
2022-04-02 18:53:11 +00:00
( +elfeed-update-async-mode +1 )
( add-hook '+elfeed-update-proceed-hook ( defun non-work-hours? ( )
" Return nil if during work hours, t otherwise. "
( let* ( ( now ( current-time ) )
( now* ( decode-time now ) )
( work-start* ( append ' ( 0 0 8 ) ( cdddr now* ) ) ) ; 8:00 AM
( work-end* ( append ' ( 0 0 18 ) ( cdddr now* ) ) ) ; 6:00 PM
( work-start ( encode-time work-start* ) )
( work-end ( encode-time work-end* ) ) )
( or ( time-less-p now work-start )
( time-less-p work-end now ) ) ) ) ) )
2021-12-18 00:31:24 +00:00
( setup ( :straight elfeed-org )
2022-01-07 23:30:46 +00:00
( :also-load +org-capture )
2022-01-04 20:41:46 +00:00
( :option rmh-elfeed-org-files ( list ( elfeed/ " elfeed.org " t ) ) )
2022-01-07 23:30:46 +00:00
( elfeed-org )
( +org-capture-templates-setf " f "
` ( " Feed " entry
2022-02-07 23:09:04 +00:00
( file+olp , ( car rmh-elfeed-org-files ) " Feeds " )
" * %? %^g " ) ) )
2021-12-18 00:31:24 +00:00
2022-04-27 13:38:03 +00:00
( setup ( :straight elpher )
( :bind " l " #' elpher-back ) )
2022-01-04 04:37:46 +00:00
2021-11-22 05:57:41 +00:00
( setup ( :straight embark )
2022-01-10 02:52:07 +00:00
( :require embark
+embark )
2022-01-07 04:55:26 +00:00
( :option prefix-help-command 'embark-prefix-help-command
embark-keymap-prompter-key " ; " )
2021-12-29 00:20:07 +00:00
( :+key " C-. " #' embark-act
2021-12-31 03:14:06 +00:00
" M-. " #' embark-dwim
" <f1> B " #' embark-bindings )
2022-01-03 16:36:32 +00:00
( :with-map minibuffer-local-map
2022-01-10 02:52:07 +00:00
( :bind " C-. " #' embark-act
" M-. " #' embark-dwim ) )
2022-01-07 05:21:59 +00:00
( :with-map embark-file-map
2022-02-17 05:19:16 +00:00
( :bind " l " #' vlf ) )
;; Integrations
( with-eval-after-load 'vertico-multiform
( setf ( alist-get 'embark-prefix-help-command vertico-multiform-commands )
nil ) ) )
2021-09-16 04:32:16 +00:00
2021-11-22 05:57:41 +00:00
( setup ( :straight embark-consult )
( :load-after consult embark )
2021-12-29 00:20:07 +00:00
( add-hook 'embark-collect-mode-hook #' consult-preview-at-point-mode ) )
2021-09-09 21:36:47 +00:00
2022-02-17 05:19:16 +00:00
( setup ( :straight embrace )
2022-05-06 15:23:02 +00:00
( dolist ( mode ' ( LaTeX-mode org-mode ruby-mode ) )
( add-hook ( intern ( format " %s-hook " mode ) )
( intern ( format " embrace-%s-hook " mode ) ) ) )
( :face 'embrace-help-pair-face ' ( ( t ( :inverse-video nil
:inherit font-lock-keyword-face ) ) ) )
2022-02-17 05:19:16 +00:00
( :+key " C-, " #' embrace-commander ) )
2022-04-24 20:02:05 +00:00
( setup ( :straight ( ement
:host github
:repo " alphapapa/ement.el " )
;; `plz' is a requirement, but isn't on an elpa.
( setup ( :straight ( plz :host github
2022-05-01 14:24:44 +00:00
:repo " alphapapa/plz.el " ) )
2022-04-24 20:02:05 +00:00
t ) ) )
2021-12-31 05:07:58 +00:00
( setup ( :straight epithet )
( dolist ( hook ' ( Info-selection-hook
2022-05-01 14:25:25 +00:00
;; eww-after-render-hook
2021-12-31 05:07:58 +00:00
help-mode-hook
occur-mode-hook ) )
2022-05-01 14:25:25 +00:00
( add-hook hook #' epithet-rename-buffer ) )
( if ( boundp 'eww-auto-rename-buffer ) ; Emacs 29
( :option eww-auto-rename-buffer 'title )
( add-hook 'eww-after-render-hook #' epithet-rename-buffer ) ) )
2021-12-31 05:07:58 +00:00
2021-12-06 04:37:41 +00:00
( setup ( :straight eros )
2022-05-01 14:25:36 +00:00
( :option eros-eval-result-prefix " ; "
eros-overlays-use-font-lock nil )
2021-12-06 04:37:41 +00:00
( :hook-into emacs-lisp-mode
lisp-interaction-mode ) )
2022-01-04 04:37:58 +00:00
( setup ( :straight eshell-bookmark )
( add-hook 'eshell-mode-hook #' eshell-bookmark-setup ) )
2021-11-22 05:57:41 +00:00
( setup ( :straight eshell-syntax-highlighting )
( :hook-into eshell-mode ) )
2021-04-29 17:16:03 +00:00
2022-04-20 03:27:03 +00:00
( setup ( :straight eshell-vterm
:quit )
( :load-after eshell )
( defalias 'eshell/v 'eshell-exec-visual )
( eshell-vterm-mode +1 ) )
2022-01-17 05:13:11 +00:00
2022-04-20 03:27:03 +00:00
( setup ( :straight exec-path-from-shell
2022-01-17 19:45:32 +00:00
( eq system-type 'gnu/linux ) )
2022-01-06 00:20:40 +00:00
( require 'exec-path-from-shell )
2022-01-05 03:10:07 +00:00
( dolist ( var ' ( " SSH_AUTH_SOCK "
" SSH_AGENT_PID "
" GPG_AGENT_INFO "
" LANG "
" LC_CTYPE "
" XDG_CONFIG_HOME "
" XDG_CONFIG_DIRS "
" XDG_DATA_HOME "
" XDG_DATA_DIRS "
" XDG_CACHE_HOME " ) )
( add-to-list 'exec-path-from-shell-variables var ) )
( exec-path-from-shell-initialize ) )
2021-09-04 15:38:06 +00:00
( setup ( :straight expand-region )
2022-01-28 23:24:53 +00:00
( :require expand-region +expand-region )
2022-01-05 17:23:26 +00:00
( :option expand-region-fast-keys-enabled nil )
( :+key " C-= " #' er/expand-region
" C-- " #' +er/contract-or-negative-argument ) )
2021-09-14 21:56:56 +00:00
2021-12-31 03:14:06 +00:00
( setup ( :straight ( fill-sentences-correctly
:host github
:repo " duckwork/fill-sentences-correctly.el " ) )
( fill-sentences-correctly-mode +1 ) )
2021-12-29 04:15:43 +00:00
( setup ( :straight ( filldent
:host github
:repo " duckwork/filldent.el " ) )
2022-04-20 15:44:51 +00:00
( :+key " M-q " #' filldent-unfill-toggle ) )
2021-12-29 04:15:43 +00:00
2022-04-12 18:19:16 +00:00
( setup ( :straight ( flymake-collection
:host github
:repo " mohkale/flymake-collection " ) )
( +ensure-after-init #' flymake-collection-hook-setup ) )
2022-01-28 01:26:33 +00:00
( setup ( :straight ( flyspell-correct
:fork ( :host github :repo " duckwork/flyspell-correct "
:branch " metadata-category " ) ) )
2022-01-11 05:52:43 +00:00
( :load-after flyspell )
2022-01-07 23:30:46 +00:00
( :also-load +flyspell-correct )
2022-01-05 23:12:32 +00:00
( :option flyspell-correct--cr-key " ; " )
( :bind-into flyspell
2022-01-06 21:46:50 +00:00
" C-; " #' flyspell-correct-wrapper
2022-01-11 22:01:03 +00:00
" <f7> " #' +flyspell-correct-buffer )
2022-02-07 04:17:56 +00:00
( with-eval-after-load 'vertico-multiform
2022-01-28 01:26:33 +00:00
( setf ( alist-get 'flyspell vertico-multiform-categories ) nil ) ) )
2022-01-05 23:12:32 +00:00
2022-04-20 15:44:51 +00:00
( setup ( :straight focus )
( :require )
( add-hook 'modus-themes-after-load-theme-hook
( defun focus-update@after-modus-load ( )
2022-05-01 14:24:44 +00:00
( modus-themes-with-colors
( :face 'focus-unfocused ` ( ( t ( :foreground , fg-inactive
:background , bg-inactive
:weight normal
:slant normal
:extend t ) ) ) ) ) ) )
2022-04-20 15:44:51 +00:00
;; XXX: This doesn't work, because notmuch overlays shit on the buffer
( setf ( alist-get 'notmuch-show-mode focus-mode-to-thing )
'notmuch-message )
( :hook-into notmuch-show-mode ) )
2022-04-20 03:27:03 +00:00
( setup ( :straight ( forge
2022-05-01 14:24:44 +00:00
:host github :repo " magit/forge " )
2022-01-17 19:45:32 +00:00
( eq system-type 'gnu/linux ) )
2022-05-06 15:23:02 +00:00
( :quit ) ; XXX: Somehow missing compat-26
2022-01-04 04:36:52 +00:00
( add-to-list 'forge-alist
' ( " tildegit.org " " tildegit.org/api/v1 " " tildegit.org "
forge-gitea-repository ) ) )
2022-01-05 17:31:12 +00:00
( setup ( :straight form-feed )
2022-04-27 13:38:03 +00:00
;; See also `page-break-lines', further down.
( :face 'form-feed-line ' ( ( t ( :strike-through t ) ) ) )
2022-01-05 17:31:12 +00:00
( global-form-feed-mode +1 ) )
2021-10-13 22:58:04 +00:00
( setup ( :straight ( frowny
:host github
:repo " duckwork/frowny.el " ) )
2022-05-06 15:23:02 +00:00
( :option frowny-eyes ( rx ( any " := " ) ( opt " ' " ) ( ? " - " ) ) )
2021-10-13 22:58:04 +00:00
( global-frowny-mode +1 ) )
2021-09-04 15:38:06 +00:00
( setup ( :straight gcmh )
( :option gcmh-idle-delay 'auto )
( gcmh-mode +1 ) )
2022-02-07 19:16:09 +00:00
( setup ( :straight ( geiser
:type git
:flavor melpa
:files ( " elisp/*.el " " doc/* " " geiser-pkg.el " )
:pre-build ( " make " " -Cdoc " " geiser.info " )
:host gitlab
2022-04-20 03:27:03 +00:00
:repo " emacs-geiser/geiser " ) )
2022-05-01 14:25:49 +00:00
( dolist ( pkg ' ( geiser-chicken geiser-guile
macrostep-geiser
scheme-complete ) )
( straight-use-package pkg ) )
2022-04-12 18:19:56 +00:00
( :require +chicken )
2022-02-07 04:17:56 +00:00
( setf ( alist-get " \\ .scm \\ ' " auto-mode-alist nil nil #' string= )
2022-04-20 15:44:51 +00:00
'scheme-mode )
2022-05-01 15:16:06 +00:00
( setf ( alist-get " \\ .scm \\ ' " auto-insert-alist nil nil #' equal )
2022-04-20 15:44:51 +00:00
' ( insert " #!/bin/sh \n #| -*- scheme -*- \n exec csi -s $0 \" $@ \" \n |# \n " ) ) )
2021-12-26 19:05:20 +00:00
2022-01-21 22:40:25 +00:00
( setup ( :straight ( git-modes
:host github :repo " magit/git-modes " ) )
( :require git-modes ) )
2022-04-20 03:27:03 +00:00
( setup ( :straight god-mode
:quit " I could never get the hang of this. " )
2022-02-17 05:06:12 +00:00
( setq god-mode-enable-function-key-translation nil )
( :require god-mode
+god-mode )
( :+key " C-M-g " #' god-mode-all )
( :with-mode god-local-mode
( :bind " i " #' +god-mode-insert
" a " nil ) ) )
2022-01-07 04:54:56 +00:00
2022-02-23 16:16:48 +00:00
( setup ( :straight helpful )
2021-12-29 00:20:07 +00:00
( :+key " <f1> f " #' helpful-callable
" <f1> v " #' helpful-variable
" <f1> k " #' helpful-key
2022-02-07 04:17:56 +00:00
" <f1> . " #' 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 ) )
2022-04-27 13:38:03 +00:00
( 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 ( )
( require 'info-look )
( info-lookup-setup-mode 'symbol 'emacs-lisp-mode ) ) ) )
2021-11-22 05:57:41 +00:00
2021-10-14 22:26:33 +00:00
( setup ( :straight ( hippie-completing-read
:host github
:repo " duckwork/hippie-completing-read " ) )
2021-12-29 00:20:07 +00:00
( :+key " M-/ " #' hippie-completing-read ) )
2021-10-14 22:26:33 +00:00
2021-09-04 15:38:06 +00:00
( setup ( :straight hungry-delete )
( :option hungry-delete-chars-to-skip " \t "
2022-01-03 16:37:03 +00:00
hungry-delete-join-reluctantly nil )
2022-01-18 23:18:06 +00:00
( +with-ensure-after-init
( add-to-list 'hungry-delete-except-modes 'eshell-mode ) )
2021-11-22 05:57:41 +00:00
( :bind-into paredit
2021-12-20 04:11:39 +00:00
;; I define these functions here because they really require both packages
;; to make any sense. So, would I put them in `+hungry-delete' or
;; `+paredit' ? There's no satisfactory answer.
2021-11-22 05:57:41 +00:00
[ remap paredit-backward-delete ]
( defun acdw/paredit-hungry-delete-backward ( arg )
( interactive " P " )
( if ( looking-back " [ \t ] " 1 )
2022-01-03 16:37:03 +00:00
( hungry-delete-backward ( or arg 1 ) )
( paredit-backward-delete arg ) ) )
2021-11-22 05:57:41 +00:00
[ remap paredit-forward-delete ]
( defun acdw/paredit-hungry-delete-forward ( arg )
( interactive " P " )
( if ( looking-at " [ \t ] " )
2022-01-03 16:37:03 +00:00
( hungry-delete-forward ( or arg 1 ) )
( paredit-forward-delete arg ) ) ) )
2021-11-22 05:57:41 +00:00
( global-hungry-delete-mode +1 ) )
2022-04-20 03:27:03 +00:00
( setup ( :straight i3wm-config-mode
( executable-find " i3 " ) ) )
2022-02-07 19:16:09 +00:00
( setup ( :straight info+ )
2022-04-20 03:25:52 +00:00
( :load-after info )
( :option Info-fontify-isolated-quote-flag nil
2022-05-05 23:41:42 +00:00
Info-breadcrumbs-in-mode-line-mode nil
Info-fontify-emphasis-flag nil
2022-04-20 03:25:52 +00:00
Info-fontify-quotations nil
Info-saved-history-file ( . etc " info-history " ) )
( add-hook 'Info-mode-hook #' Info-variable-pitch-text-mode ) )
2022-02-07 19:16:09 +00:00
2021-11-22 05:57:41 +00:00
( setup ( :straight isearch-mb )
;; This complicatedness is an attempt to make it easier to add and
;; subtract `isearch-mb' bindings using the suggestions in the
;; project's README.
2022-02-07 04:17:56 +00:00
( :load-after consult anzu )
( :when-loaded
2021-11-22 05:57:41 +00:00
( dolist ( spec ' ( ( isearch-mb--with-buffer
2022-01-03 16:37:03 +00:00
( " M-e " . consult-isearch )
( " C-o " . loccur-isearch ) )
( isearch-mb--after-exit
( " M-% " . anzu-isearch-query-replace )
( " M-s l " . consult-line ) ) ) )
2021-11-22 05:57:41 +00:00
( let ( ( isearch-mb-list ( car spec ) )
2022-01-03 16:37:03 +00:00
( isearch-mb-binds ( cdr spec ) ) )
( dolist ( cell isearch-mb-binds )
( let ( ( key ( car cell ) )
( command ( cdr cell ) ) )
( when ( fboundp command )
( add-to-list isearch-mb-list command )
( define-key isearch-mb-minibuffer-map ( kbd key ) command ) ) ) ) ) ) )
2021-11-22 05:57:41 +00:00
( isearch-mb-mode +1 ) )
2021-10-02 00:06:13 +00:00
2022-04-24 20:02:12 +00:00
( setup ( :straight ( jabber :repo " https://codeberg.org/emacs-jabber/emacs-jabber "
2022-01-24 19:24:39 +00:00
:host nil
:files ( " *.el " " *.texi "
2022-02-07 23:09:04 +00:00
( " jabber-fallback-lib "
" jabber-fallback-lib/hexrgb.el "
" jabber-fallback-lib/srv.el "
" jabber-fallback-lib/fsm.el " )
2022-04-27 13:38:03 +00:00
" jabber-pkg.el " )
:fork ( :host nil
:repo " https://codeberg.org/acdw/emacs-jabber " ) ) )
2022-01-25 22:55:44 +00:00
( :also-load +jabber )
( :option jabber-account-list ' ( ( " acdw@hmm.st " ) )
2022-04-27 13:38:03 +00:00
jabber-groupchat-buffer-format " %n "
jabber-chat-buffer-format " %n "
jabber-muc-private-buffer-format " %n(%g) "
2022-02-03 00:28:39 +00:00
jabber-activity-show-p #' ignore
jabber-muc-decorate-presence-patterns
' ( ( " \\ ( enters the room ([^)]+) \\ | has left the chatroom \\ )$ " )
2022-04-24 20:02:12 +00:00
( " . " . jabber-muc-presence-dim ) )
2022-05-06 15:23:02 +00:00
jabber-muc-colorize-foreign nil ; colorizing doesn't match my color theme
2022-04-27 13:38:03 +00:00
jabber-chat-foreign-prompt-format ( concat +jabber-pre-prompt
" [%t] %n \n "
2022-04-24 20:02:12 +00:00
( make-string +jabber-ws-prefix
?\ ) )
2022-04-27 13:38:03 +00:00
jabber-chat-local-prompt-format ( concat +jabber-pre-prompt
" [%t] %n \n "
2022-04-24 20:02:12 +00:00
( make-string +jabber-ws-prefix
?\ ) )
2022-04-27 13:38:03 +00:00
jabber-groupchat-prompt-format ( concat +jabber-pre-prompt
" [%t] %n \n "
2022-04-24 20:02:12 +00:00
( make-string +jabber-ws-prefix
?\ ) )
jabber-auto-reconnect t )
( add-hook 'modus-themes-after-load-theme-hook
( defun jabber-chat@after-modus-themes-load ( )
( modus-themes-with-colors
( :face 'jabber-chat-prompt-foreign ` ( ( t ( :foreground , red ) ) )
'jabber-chat-prompt-local ` ( ( t ( :foreground , blue ) ) )
2022-04-27 13:38:03 +00:00
'jabber-chat-prompt-system ` ( ( t ( :foreground , green ) ) ) ) )
( setq jabber-muc-nick-value ( pcase ( frame--current-backround-mode ( selected-frame ) )
( 'light 0.5 )
( 'dark 1.0 ) ) )
( +mapc-some-buffers #' +jabber-colors-update
( lambda ( ) ( derived-mode-p 'jabber-chat-mode
'jabber-roster-mode
'jabber-activity-mode
'jabber-browse-mode ) ) ) ) )
2022-01-24 19:24:39 +00:00
( dolist ( mode ' ( jabber-chat-mode
jabber-browse-mode
jabber-roster-mode
jabber-console-mode ) )
2022-04-27 13:38:03 +00:00
( let ( ( hook ( intern ( format " %s-hook " mode ) ) ) )
( add-hook hook #' visual-fill-column-mode ) ) )
2022-04-28 20:49:42 +00:00
( with-eval-after-load 'tracking
( add-to-list 'tracking-ignored-buffers " discuss@conference.soprani.ca " ) )
2022-04-24 20:02:12 +00:00
( :with-mode jabber-chat-mode
( :local-set +modeline-position-function ( lambda ( )
( cond
( ( string-match-p " hmm@ " ( buffer-name ) )
" 🤔 " ) ) )
2022-05-05 23:41:42 +00:00
file-percentage-mode nil
2022-04-27 13:38:03 +00:00
wrap-prefix ( make-string +jabber-ws-prefix ?\ ) ) )
2022-01-25 22:55:44 +00:00
( :+leader " C-j " jabber-global-keymap )
( advice-add 'jabber-activity-add :after #' +jabber-tracking-add )
( advice-add 'jabber-activity-add-muc :after #' +jabber-tracking-add-muc ) )
2022-01-24 19:24:39 +00:00
2022-02-03 00:28:39 +00:00
( setup ( :straight ( keepassxc-shim
:host github :repo " duckwork/keepassxc-shim.el " ) )
( keepassxc-shim-activate ) )
2022-04-20 03:27:03 +00:00
( setup ( :straight keychain-environment
2022-01-02 16:00:53 +00:00
( executable-find " keychain " ) )
( keychain-refresh-environment ) )
2021-09-04 15:38:06 +00:00
( setup ( :straight lacarte )
2022-01-14 00:01:12 +00:00
( :+key " <f10> " #' 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 ) ) ) ) )
2021-09-04 15:38:06 +00:00
2022-04-24 20:02:19 +00:00
( setup ( :straight ( lin :host nil
:repo " https://git.sr.ht/~protesilaos/lin " ) )
( :require )
2022-04-20 03:26:11 +00:00
( lin-global-mode +1 ) )
2021-12-18 00:31:24 +00:00
2021-12-31 21:45:06 +00:00
( setup ( :straight link-hint )
( :require +link-hint )
2022-02-07 04:17:56 +00:00
( +link-hint-open-secondary-setup )
2022-02-17 05:19:16 +00:00
( +link-hint-open-chrome-setup )
2021-12-31 21:45:06 +00:00
( :option link-hint-avy-style 'at-full )
2022-01-05 17:24:46 +00:00
( :+key " M-l " +link-hint-map )
( :with-map +link-hint-map
( :bind " M-l " #' +link-hint-open-link " l " #' +link-hint-open-link
2022-02-07 04:17:56 +00:00
" M-o " #' +link-hint-open-secondary " o " #' +link-hint-open-secondary
" M-m " #' link-hint-open-multiple-links " m " #' link-hint-open-multiple-links
2022-02-17 05:19:16 +00:00
" M-w " #' link-hint-copy-link " w " #' link-hint-copy-link
" M-c " #' +link-hint-open-chrome " c " #' +link-hint-open-chrome ) ) )
2021-12-31 21:45:06 +00:00
2022-01-24 19:24:30 +00:00
( setup ( :straight ( machine
2022-02-28 15:39:35 +00:00
:host github
:repo " duckwork/machine.el " ) )
2022-01-31 23:27:21 +00:00
( +with-ensure-after-init ; So that they override anything here.
2022-02-07 04:17:56 +00:00
;; Emoji fonts
( let ( ( ffl ( font-family-list ) )
( emoji-fonts ' ( " Noto Color Emoji "
" Noto Emoji "
" Segoe UI Emoji "
" Apple Color Emoji "
" FreeSans "
" FreeMono "
" FreeSerif "
" Unifont "
" Symbola " ) )
found )
( dolist ( font emoji-fonts )
( when ( member font ffl )
( push font found )
( set-fontset-font t 'symbol ( font-spec :family font ) nil :append ) ) )
( nreverse found ) )
( machine-settings-load ) ) )
2022-01-24 19:24:30 +00:00
2022-01-10 02:52:07 +00:00
( setup ( :straight macrostep )
( :require macrostep )
2022-02-03 00:28:39 +00:00
( dolist ( m ' ( emacs-lisp-mode-map
lisp-interaction-mode-map ) )
( define-key ( symbol-value m ) ( kbd " C-c e " ) #' macrostep-expand ) ) )
2022-01-10 02:52:07 +00:00
2022-01-21 22:40:25 +00:00
( setup ( :straight ( magit :host github :repo " magit/magit " ) ) )
2021-09-04 15:38:06 +00:00
( setup ( :straight marginalia )
( marginalia-mode +1 ) )
2022-01-10 14:33:38 +00:00
( setup ( :straight markdown-mode )
2022-01-20 14:28:49 +00:00
( :option markdown-hide-markup nil )
2022-01-10 14:33:38 +00:00
( add-to-list 'auto-mode-alist ( cons ( rx ( or " .md " " .markdown " " .mdown " )
eos )
'markdown-mode ) )
2022-02-08 20:16:40 +00:00
( with-eval-after-load 'visual-fill-column
( :hook #' visual-fill-column-mode ) )
2022-01-10 14:33:38 +00:00
( with-eval-after-load 'apheleia
( when-let ( ( mdfmt-exe ( executable-find " markdownfmt " ) ) )
( setf ( alist-get 'markdownfmt apheleia-formatters ) mdfmt-exe )
( setf ( alist-get 'markdown-mode apheleia-mode-alist ) 'markdownfmt )
( setf ( alist-get 'gfm-mode apheleia-mode-alist ) 'markdownfmt ) ) ) )
2022-01-18 23:18:06 +00:00
( setup ( :straight mastodon )
( :option mastodon-instance-url " https://tiny.tilde.website "
2022-05-06 15:23:02 +00:00
mastodon-active-user " acdw "
2022-01-18 23:18:06 +00:00
mastodon-client--token-file ( . etc " mastodon.plstore " )
2022-02-07 04:17:56 +00:00
mastodon-auth-source-file ( seq-some ( lambda ( i )
( when ( and ( stringp i )
( file-exists-p i ) )
i ) )
auth-sources )
2022-02-19 00:25:27 +00:00
mastodon-tl--show-avatars t
mastodon-tl--enable-proportional-fonts nil )
2022-01-18 23:18:06 +00:00
( :hook #' mastodon-async-mode
2022-02-19 00:25:27 +00:00
#' visual-fill-column-mode
#' variable-pitch-mode
2022-01-18 23:18:06 +00:00
#' hl-line-mode
#' lin-mode ) )
2022-04-20 03:27:03 +00:00
( setup ( :straight md4rd
:quit )
2022-02-17 05:06:12 +00:00
;; `md4rd' is ... a bit janky, tbh. But I'm including this here so I have it.
;; TODO: enable opening Reddit links in md4rd
( :also-load _md4rd )
( defalias 'reddit 'md4rd " Browse Reddit. " )
( with-eval-after-load 'md4rd
( run-with-timer 0 ( * 60 59 ) 'md4rd-refresh-login ) ) )
2022-01-21 22:34:55 +00:00
2021-11-22 05:57:41 +00:00
( setup ( :straight minions )
( minions-mode +1 ) )
2021-09-04 15:38:06 +00:00
2022-01-02 01:25:44 +00:00
( setup ( :straight ( mode-line-bell
2022-01-17 19:45:32 +00:00
:host github :repo " purcell/mode-line-bell "
2022-01-20 14:29:04 +00:00
:fork ( :host github :repo " duckwork/mode-line-bell "
:branch " remap-face " ) ) )
2022-02-07 04:17:56 +00:00
;; This is still, annoyingly, not quite working right.
2022-04-20 15:44:51 +00:00
( :face 'mode-line-bell ' ( ( t ( :inherit mode-line-highlight ) ) ) )
2021-10-21 23:59:54 +00:00
( :option mode-line-bell-flash-time 0.1 )
( mode-line-bell-mode +1 ) )
2021-09-04 15:38:06 +00:00
( setup ( :straight ( modus-themes
2022-04-24 20:02:19 +00:00
:host nil
:repo " https://git.sr.ht/~protesilaos/modus-themes " ) )
2021-12-18 00:31:24 +00:00
( require 'modus-themes ( . etc " straight/build/modus-themes/modus-themes " ) )
2022-01-14 00:01:12 +00:00
( :option modus-themes-mixed-fonts t
2022-04-12 18:19:49 +00:00
modus-themes-bold-constructs t
2021-12-18 00:31:24 +00:00
modus-themes-italic-constructs t
2022-04-20 15:44:51 +00:00
modus-themes-headings ' ( ( t t ) ) )
2022-01-31 23:27:21 +00:00
( dotimes ( facen-1 8 )
( let ( ( facen ( 1+ facen-1 ) ) )
( custom-set-faces
` ( , ( intern ( format " org-level-%s " facen ) )
2022-02-07 23:09:04 +00:00
( ( t :inherit
( , ( intern ( format " modus-themes-heading-%s " facen ) )
fixed-pitch ) )
:now ) ) ) ) )
2022-04-20 15:44:51 +00:00
( :face 'modus-themes-tab-active ' ( ( t :bold nil ) )
'modus-themes-tab-inactive ' ( ( t :italic t ) ) )
2022-04-02 18:56:25 +00:00
2022-04-20 15:44:51 +00:00
( define-advice modus-themes--current-theme ( :around ( fn &rest r ) )
2022-04-27 13:38:03 +00:00
" Fix a \" nil is not a Modus theme \" error. "
2022-04-20 15:44:51 +00:00
( or ( apply fn r )
'modus-operandi ) )
;; This needs to be after the themes are loaded, I think.
2022-04-02 18:56:25 +00:00
( add-hook 'modus-themes-after-load-theme-hook
( defun +modus-themes-mostly-monochrome ( )
" Set up mdous-themes to be mostly monochrome. "
( modus-themes-with-colors
( custom-set-faces
2022-04-12 18:19:49 +00:00
` ( font-lock-builtin-face ( ( , class :inherit modus-themes-bold
:foreground unspecified ) ) )
2022-04-02 18:56:25 +00:00
` ( font-lock-comment-delimiter-face ( ( , class :inherit font-lock-comment-face ) ) )
2022-04-28 20:48:21 +00:00
` ( font-lock-comment-face ( ( , class :inherit variable-pitch
:slant italic
2022-04-12 18:19:49 +00:00
:foreground , fg-docstring ) ) )
` ( font-lock-constant-face ( ( , class :inherit underline
:foreground unspecified ) ) )
` ( font-lock-doc-face ( ( , class :inherit modus-themes-slant
:foreground , fg-docstring ) ) )
2022-04-02 18:56:25 +00:00
` ( font-lock-function-name-face ( ( , class :foreground unspecified ) ) )
2022-04-12 18:19:49 +00:00
` ( font-lock-keyword-face ( ( , class :inherit modus-themes-bold
:foreground unspecified ) ) )
` ( font-lock-negation-char-face ( ( , class :inherit modus-themes-bold
:foreground unspecified ) ) )
2022-04-02 18:56:25 +00:00
` ( font-lock-preprocessor-face ( ( , class :foreground unspecified ) ) )
` ( font-lock-regexp-grouping-backslash ( ( , class :foreground , fg-escape-char-backslash ) ) )
` ( font-lock-regexp-grouping-construct ( ( , class :foreground , fg-escape-char-construct ) ) )
2022-04-12 18:19:49 +00:00
` ( font-lock-string-face ( ( , class :inherit modus-themes-slant
:foreground unspecified ) ) )
` ( font-lock-type-face ( ( , class :inherit modus-themes-bold
:foreground unspecified ) ) )
2022-04-02 18:56:25 +00:00
` ( font-lock-variable-name-face ( ( , class :foreground unspecified ) ) )
2022-04-12 18:19:49 +00:00
` ( font-lock-warning-face ( ( , class :inherit modus-themes-bold
:foreground , red-nuanced-fg ) ) )
` ( font-lock-todo-face ( ( , class :inherit font-lock-comment-face
:foreground , fg-header
:background , yellow-intense-bg ) ) ) ) ) ) )
2022-04-02 18:56:25 +00:00
2022-04-20 15:44:51 +00:00
( require 'dawn )
2022-01-21 23:41:57 +00:00
( dawn-schedule #' modus-themes-load-operandi
#' modus-themes-load-vivendi ) )
2021-03-29 22:52:23 +00:00
2021-09-04 15:38:06 +00:00
( setup ( :straight mwim )
2022-01-17 05:13:11 +00:00
( :require +mwim )
( :option +mwim-passthrough-modes ' ( comint-mode
eshell-mode
2022-02-07 04:17:56 +00:00
vterm-mode
2022-03-12 02:04:05 +00:00
crossword-mode
geiser-repl-mode ) )
( :global " C-a " #' mwim-beginning
" C-e " #' mwim-end ) )
2021-03-29 22:52:23 +00:00
2022-02-17 05:19:16 +00:00
( setup ( :straight notmuch-bookmarks )
( :load-after notmuch )
( :when-loaded
( notmuch-bookmarks-mode +1 ) ) )
2022-04-20 03:27:03 +00:00
( setup ( :straight notmuch-labeler
:quit " Buggy " )
2022-02-17 05:19:16 +00:00
( :load-after notmuch ) )
2022-04-27 13:38:03 +00:00
( setup ( :straight nov )
( :hook #' visual-fill-column-mode )
( :file-match ( rx " .epub " eos ) ) )
2022-02-17 05:19:16 +00:00
( setup ( :straight ol-notmuch ) )
2021-11-22 05:57:41 +00:00
( setup ( :straight orderless )
2022-01-21 22:34:55 +00:00
( :require +orderless )
2022-01-15 03:03:36 +00:00
( :option completion-styles ' ( substring orderless basic )
completion-category-defaults nil
completion-category-overrides
2022-05-06 15:23:02 +00:00
' ( ( file ( styles basic partial-completion ) )
2022-01-15 03:03:36 +00:00
( command ( styles +orderless-with-initialism ) )
( variable ( styles +orderless-with-initialism ) )
( symbol ( styles +orderless-with-initialism ) ) )
orderless-component-separator #' orderless-escapable-split-on-space
orderless-style-dispatchers ' ( +orderless-dispatch ) ) )
2021-04-10 22:31:40 +00:00
2021-09-02 02:15:57 +00:00
( setup ( :straight org-appear )
2021-09-23 22:11:30 +00:00
( :option org-appear-autoemphasis t
org-appear-autoentities t
org-appear-autokeywords t
org-appear-autolinks nil
org-appear-autosubmarkers t
org-appear-delay 0 )
2021-09-02 02:15:57 +00:00
( :hook-into org-mode ) )
2022-01-28 23:25:02 +00:00
( setup ( :straight org-download )
2022-03-12 02:04:05 +00:00
( :require )
2022-01-28 23:25:02 +00:00
( :option org-download-method 'attach
org-download-backend ( cond ( ( executable-find " curl " ) 'curl )
( ( executable-find " wget " ) 'wget )
( :else 'url-retrieve ) ) )
( add-hook 'dired-mode-hook 'org-download-enable ) )
2022-04-20 15:43:20 +00:00
( setup ( :straight ( org-drawer-list
:host github
:repo " d12frosted/org-drawer-list " ) )
( :load-after org )
( :also-load +org-drawer-list ) )
2022-03-12 02:04:05 +00:00
( setup ( :straight org-mime )
2022-04-20 03:26:26 +00:00
( :option org-mime-export-ascii 'utf-8 )
2022-02-23 16:16:48 +00:00
( add-hook 'message-mode-hook
( defun org-mime-setup@message-mode ( )
( local-set-key ( kbd " C-c M-o " ) 'org-mime-htmlize ) ) )
( add-hook 'org-mode-hook
( defun org-mime-setup@org-mode ( )
( local-set-key ( kbd " C-c M-o " ) 'org-mime-org-buffer-htmlize ) ) ) )
2022-04-20 15:44:51 +00:00
( setup ( :straight org-modern )
2022-05-06 15:23:02 +00:00
( :quit " I think I can do most of this myself. " )
2022-04-20 15:44:51 +00:00
( :option org-modern-hide-stars nil
org-modern-star nil
2022-04-27 13:38:03 +00:00
org-modern-list nil
org-modern-progress [ " ... " " o.. " " oo. " " Oo. " " Ooo " " OOo " " OOO " ] )
2022-04-20 15:44:51 +00:00
( :face 'org-modern-label ' ( ( t ( :height 1.0
:weight regular
:underline nil
:inherit fixed-pitch ) ) ) )
( advice-add 'org-modern--update-label-face :override #' ignore )
( :hook-into org-mode ) )
2022-02-28 15:39:42 +00:00
( setup ( :straight ( org-taskwise
:host github
:repo " duckwork/org-taskwise.el " ) )
2022-03-12 02:04:05 +00:00
( with-eval-after-load 'org
( require 'org-taskwise )
( define-key org-mode-map ( kbd " C-x n t " ) #' org-taskwise-narrow-to-task ) ) )
2022-02-28 15:39:42 +00:00
2022-01-02 01:25:49 +00:00
( setup ( :straight org-visibility )
2022-01-28 23:24:53 +00:00
( :require org-visibility )
2022-01-02 16:00:47 +00:00
( :option org-visibility-state-file ( . etc " org-visibility " )
org-visibility-include-regexps ' ( " \\ .org \\ ' " ) )
2022-01-28 23:24:53 +00:00
( org-visibility-enable-hooks ) )
2022-01-02 01:25:49 +00:00
2022-01-10 05:58:04 +00:00
( setup ( :straight orglink )
2022-05-06 15:23:02 +00:00
( :option orglink-activate-in-modes ' ( text-mode prog-mode ) )
( global-orglink-mode +1 )
( global-goto-address-mode -1 ) )
2022-01-10 05:58:04 +00:00
2022-01-24 13:58:12 +00:00
( setup ( :straight package-lint ) )
( setup ( :straight package-lint-flymake )
2021-12-31 21:45:15 +00:00
( add-hook 'emacs-mode-hook #' package-lint-flymake-setup )
;; Remove it from init.el files
( add-hook '+init-mode-hook #' flymake-mode-off ) )
2021-12-30 04:55:55 +00:00
2022-04-27 13:38:03 +00:00
( setup ( :straight page-break-lines )
( :option page-break-lines-char ?— )
( :hook-into jabber-chat-mode ) )
2021-10-09 21:21:24 +00:00
( setup ( :straight paredit )
2022-04-24 20:00:11 +00:00
( :also-load +paredit )
2021-12-29 00:20:07 +00:00
( :bind " DEL " #' paredit-backward-delete
2022-04-24 20:00:11 +00:00
" C-<backspace> " #' +paredit-backward-kill-word
2022-01-07 04:55:26 +00:00
" C-w " ( lambda ( arg ) ( interactive " P " )
( +kill-word-backward-or-region arg
#' paredit-backward-kill-word ) )
" M-s " nil )
2021-12-30 04:55:55 +00:00
( dolist ( hook ' ( emacs-lisp-mode-hook
eval-expression-minibuffer-setup-hook
ielm-mode-hook
lisp-interaction-mode-hook
lisp-mode-hook
2022-02-01 21:05:20 +00:00
scheme-mode-hook
2022-03-12 02:04:05 +00:00
geiser-mode-hook
geiser-repl-mode-hook ) )
2021-12-30 04:55:55 +00:00
( add-hook hook #' enable-paredit-mode ) )
2021-10-09 21:21:24 +00:00
( :also-load eldoc )
2021-12-29 00:20:07 +00:00
( eldoc-add-command #' paredit-backward-delete #' paredit-close-round ) )
2021-10-09 21:21:24 +00:00
2021-09-04 15:38:06 +00:00
( setup ( :straight paren-face )
2021-09-25 18:15:42 +00:00
( :hook-into emacs-lisp-mode
ielm-mode sly-repl-mode
lisp-mode
lisp-interaction-mode
scheme-mode ) )
2021-09-04 15:38:06 +00:00
2022-04-20 03:27:03 +00:00
( setup ( :straight pdf-tools
( or ( executable-find " gcc " )
( executable-find " g++ " ) ) )
( setf ( alist-get " \\ .pdf \\ ' " auto-mode-alist nil nil #' equal )
#' pdf-view-mode )
2022-05-05 23:42:02 +00:00
( pdf-tools-install :no-query ) )
2022-03-30 23:14:56 +00:00
2022-01-30 01:34:08 +00:00
( setup ( :straight ( plancat
:host github
2022-02-23 16:16:48 +00:00
:repo " duckwork/plancat.el "
:local-repo " ~/src/emacs-packages/plancat.el/ " ) )
2022-01-30 01:34:08 +00:00
( :option plancat-user " acdw " ) )
2022-02-07 04:17:56 +00:00
( setup ( :straight pocket-reader )
( :option pocket-reader-open-url-default-function #' browse-url )
2022-02-17 05:19:16 +00:00
( :+leader " p " #' pocket-reader
" C-p " #' pocket-reader )
2022-02-07 04:17:56 +00:00
( dolist ( mode ' ( ( eww-mode-map . eww )
( w3m-mode-map . w3m )
( elfeed-search-mode-map . elfeed-search )
( elfeed-show-mode-map . elfeed-show ) ) )
( with-eval-after-load ( cdr mode )
( define-key ( symbol-value ( car mode ) ) " \" " #' pocket-reader-add-link ) )
( with-eval-after-load '+link-hint
( +link-hint-pocket-add-setup )
( define-key +link-hint-map " M- \" " #' +link-hint-pocket-add )
( define-key +link-hint-map " \" " #' +link-hint-pocket-add ) ) ) )
2022-04-12 18:19:16 +00:00
( setup ( :straight rainbow-mode )
( :hook-into prog-mode ) )
2022-04-20 15:44:51 +00:00
( setup ( :straight restart-emacs ) )
2021-09-28 04:07:50 +00:00
( setup ( :straight ( shell-command+
:host nil
:repo " https://git.sr.ht/~pkal/shell-command-plus " ) )
2021-09-04 15:38:06 +00:00
( :option shell-command-prompt " $ " )
2021-11-22 05:57:41 +00:00
( :bind-into dired
" M-! " 'shell-command+ )
2021-12-29 00:20:07 +00:00
( :+key " M-! " #' shell-command+ ) )
2021-10-02 05:04:16 +00:00
2021-12-26 19:05:20 +00:00
( setup ( :straight sicp ) )
2021-12-05 05:09:33 +00:00
( setup ( :straight ( simple-modeline
2022-01-17 19:45:32 +00:00
:host github :repo " gexplorer/simple-modeline "
2021-12-30 04:55:55 +00:00
:fork ( :host github :repo " duckwork/simple-modeline " ) ) )
2021-12-31 06:10:51 +00:00
( :require +modeline )
2022-03-30 23:14:56 +00:00
( :option +modeline-modified-icon-alist ' ( ( ephemeral . " ~ " )
( special . " * " )
( readonly . " = " )
( modified . " + " )
( t . " - " ) )
2022-05-05 23:41:42 +00:00
+modeline-minions-icon " & "
2022-04-20 15:44:51 +00:00
+modeline-buffer-name-max-length 0.35 )
;; Segments
( :option simple-modeline-segments
2022-02-01 21:05:20 +00:00
` ( ( ; left
2022-01-11 05:44:45 +00:00
+modeline-ace-window-display
+modeline-modified
+modeline-buffer-name
2022-02-17 05:17:56 +00:00
( lambda ( ) ( +modeline-vc " : " ) )
2022-01-11 05:44:45 +00:00
+modeline-anzu
)
2022-02-01 21:05:20 +00:00
( ; right
2022-01-11 05:44:45 +00:00
( lambda ( )
( unless +tab-bar-misc-info-mode
( +modeline-concat
' ( +modeline-track
simple-modeline-segment-misc-info ) ) ) )
simple-modeline-segment-process
+modeline-text-scale
, ( +modeline-concat
' ( +modeline-god-mode
2022-03-12 02:04:05 +00:00
+modeline-kmacro-indicator
2022-01-11 05:44:45 +00:00
+modeline-reading-mode
+modeline-narrowed )
" , " )
2022-02-28 15:40:07 +00:00
+modeline-input-method
2022-04-20 15:44:51 +00:00
+modeline-position
2022-05-05 23:41:42 +00:00
, ( +modeline-concat
' ( +modeline-minions
+modeline-major-mode ) )
+modeline-file-percentage
2022-02-17 05:17:56 +00:00
) ) )
2021-12-05 05:09:33 +00:00
( simple-modeline-mode +1 ) )
2022-01-31 23:26:39 +00:00
( setup ( :straight slack )
( :also-load +slack )
( :option slack-prefer-current-team t
slack-buffer-emojify t
2022-05-06 15:23:02 +00:00
slack-thread-also-send-to-room nil
slack-typing-visibility 'buffer
2022-01-31 23:26:39 +00:00
slack-buffer-create-on-notify t
slack-enable-wysiwyg t
2022-03-30 23:14:56 +00:00
slack-file-dir ( xdg-user-dir " DOWNLOAD " )
2022-02-09 02:59:23 +00:00
slack-display-team-name nil )
2022-01-31 23:26:39 +00:00
( with-eval-after-load '+slack
2022-03-30 23:14:56 +00:00
( +slack-register-teams ) )
( with-eval-after-load 'alert
;; Don't notify for Slack messages
( alert-add-rule :category " slack "
:style 'ignore ) ) )
2022-01-31 23:26:39 +00:00
2022-04-20 03:27:03 +00:00
( setup ( :straight sly
2022-01-17 05:13:11 +00:00
( defvar +lisp-bin ( executable-find " sbcl " ) ) )
( :also-load sly-autoloads
+sly )
( :option inferior-lisp-program +lisp-bin
sly-kill-without-query-p t )
( :with-feature sly-mrepl
( dolist ( key ' ( " RET " " <return> " ) )
( :bind key #' sly-mrepl-return-at-end ) )
( :bind " C-c C-c " #' sly-mrepl-return ) ) )
2021-12-07 01:58:46 +00:00
( setup ( :straight smartscan )
2022-01-07 04:55:26 +00:00
( :with-map smartscan-map
( :bind " M-' " nil ) )
2021-12-27 04:49:50 +00:00
( :hook-into prog-mode ) )
2021-12-18 00:31:24 +00:00
2022-01-03 23:16:35 +00:00
( setup ( :straight ( sophomore
:host github
:repo " duckwork/sophomore.el " ) )
2022-01-07 23:30:46 +00:00
( sophomore-enable #' narrow-to-region )
2022-01-14 00:01:12 +00:00
( sophomore-disable ; These are mostly annoying commands
#' view-hello-file
2022-05-06 15:23:02 +00:00
#' describe-gnu-project
#' suspend-frame )
2022-01-04 22:45:45 +00:00
( sophomore-mode +1 ) )
2022-01-03 23:16:35 +00:00
2022-05-06 17:41:31 +00:00
( setup ( :straight ( spongebob-case
:host github
:repo " duckwork/spongebob-case.el " ) )
( define-key +casing-map ( kbd " M-s " ) #' spongebob-case-dwim ) )
2021-06-03 04:38:30 +00:00
( setup ( :straight ssh-config-mode )
2021-09-04 15:38:06 +00:00
( :file-match ( rx " /.ssh/config " eos )
( rx " /ssh " ( ? " d " ) " _config " eos ) )
( :with-mode ssh-known-hosts-mode
( :file-match ( rx " /knownhosts " eos ) ) )
( :with-mode ssh-authorized-keys-mode
2021-11-22 05:57:41 +00:00
( :file-match ( rx " /authorized_keys " ( ? " 2 " ) eos ) ) ) )
2021-06-03 04:38:30 +00:00
2021-09-27 23:21:23 +00:00
( setup ( :straight super-save )
( :option auto-save-default nil
2021-10-11 23:03:50 +00:00
super-save-auto-save-when-idle t
2022-05-06 15:23:02 +00:00
super-save-idle-duration 30
2021-09-27 23:21:23 +00:00
super-save-exclude ' ( " .gpg " )
super-save-remote-files nil )
( auto-save-visited-mode -1 )
( super-save-mode +1 ) )
2022-04-20 03:27:03 +00:00
( setup ( :straight systemd
2022-01-17 05:13:11 +00:00
( executable-find " systemd " ) )
( :option systemd-man-function 'woman ) )
2021-12-27 04:48:45 +00:00
( setup ( :straight ( titlecase
:host github
2021-12-29 00:20:16 +00:00
:repo " duckwork/titlecase.el "
2022-01-04 20:40:46 +00:00
:files ( " * " ) ) )
2022-01-10 02:52:07 +00:00
( :require titlecase )
( :with-map +casing-map
( :bind " t " #' titlecase-dwim
" M-t " #' titlecase-dwim ) ) )
2021-12-27 04:48:45 +00:00
2021-12-07 01:58:46 +00:00
( setup ( :straight topsy )
2022-01-07 23:30:46 +00:00
( :hook-into ;;prog-mode
circe-chat-mode )
2021-12-07 01:58:46 +00:00
( :when-loaded
( :option
topsy-header-line-format
' ( :eval
( list
( propertize " "
2022-02-07 23:09:04 +00:00
'display
` ( ( space
:align-to
, ( unless ( bound-and-true-p visual-fill-column-mode )
0 ) ) ) )
2021-12-07 01:58:46 +00:00
( funcall topsy-fn ) ) ) ) ) )
2022-01-04 06:40:34 +00:00
( setup ( :straight transpose-frame )
( defvar +transpose-frame-map
( let ( ( map ( make-sparse-keymap ) ) )
( dolist ( bind ' ( ( " t " . transpose-frame )
( " v " . flip-frame )
( " h " . flop-frame )
( " r " . rotate-frame-clockwise )
( " R " . rotate-frame-anticlockwise ) ) )
( define-key map ( car bind ) ( cdr bind ) ) )
map )
" Map for transposing frames. " )
( define-key +key-mode-map ( kbd " C-x 5 t " ) +transpose-frame-map ) )
2021-12-18 00:31:24 +00:00
2021-09-06 17:52:51 +00:00
( setup ( :straight trashed )
( :option trashed-action-confirmer #' y-or-n-p ) )
2021-04-29 17:16:03 +00:00
( setup ( :straight undo-fu )
2022-04-13 03:40:28 +00:00
( :option undo-fu-allow-undo-in-region t )
2022-02-07 19:16:09 +00:00
( :global " C-/ " #' undo-fu-only-undo
" C-? " #' undo-fu-only-redo ) )
2021-04-03 14:48:05 +00:00
2021-04-29 17:16:03 +00:00
( setup ( :straight undo-fu-session )
( :option undo-fu-session-incompatible-files ' ( " /COMMIT_EDITMSG \\ ' "
" /git-rebase-todo \\ ' " )
2021-11-22 05:57:41 +00:00
undo-fu-session-directory ( . etc " undo/ " t )
2022-04-13 03:40:28 +00:00
undo-fu-session-compression ( cond
( ( executable-find " gzip " ) 'gz )
( ( executable-find " bzip2 " ) 'bz2 )
( ( executable-find " xz " ) 'xz )
( t nil ) ) )
2021-04-29 17:16:03 +00:00
( global-undo-fu-session-mode +1 ) )
2021-03-29 22:52:23 +00:00
2022-04-13 03:40:28 +00:00
( setup ( :straight ( undo-hl
:host github
:repo " casouri/undo-hl " ) )
( :require )
( :hook-into text-mode prog-mode ) )
2022-02-07 04:17:56 +00:00
( setup ( :straight unfill ) )
2022-03-30 23:14:56 +00:00
2022-04-20 03:27:03 +00:00
( setup ( :straight valign
:quit " Doesn't work with narrowed tables. " )
2022-02-17 05:06:12 +00:00
( :option valign-fancy-bar t )
( :hook-into org-mode
markdown-mode ) )
2022-01-21 22:34:55 +00:00
2021-09-04 15:38:06 +00:00
( setup ( :straight ( vertico
:host github
:repo " minad/vertico "
:files ( " * " " extensions/* "
2022-02-07 23:09:04 +00:00
( :exclude " .git " ) ) ) )
2022-03-30 23:14:56 +00:00
( :require vertico +vertico )
2021-09-04 15:38:06 +00:00
( :option resize-mini-windows 'grow-only
vertico-count-format nil
vertico-cycle t )
2021-12-29 00:20:07 +00:00
( advice-add #' vertico-next :around #' +vertico-ding-wrap )
2021-09-04 15:38:06 +00:00
( when ( boundp 'native-comp-deferred-compilation-deny-list )
( add-to-list 'native-comp-deferred-compilation-deny-list " vertico " ) )
( vertico-mode +1 )
2021-11-22 05:57:41 +00:00
;; Extensions
2022-01-10 02:52:07 +00:00
( :also-load vertico-directory
vertico-mouse
vertico-unobtrusive
2022-01-12 04:28:32 +00:00
vertico-multiform
vertico-quick )
2022-01-10 02:52:07 +00:00
( vertico-mouse-mode +1 )
( vertico-multiform-mode +1 )
2022-02-07 04:17:56 +00:00
;; 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 )
2022-04-27 13:38:03 +00:00
( setf ( alist-get 'file vertico-multiform-categories ) nil )
2022-02-07 04:17:56 +00:00
( 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 )
2021-09-23 22:11:30 +00:00
( :with-map vertico-map
2021-12-29 00:20:07 +00:00
( :bind " RET " #' vertico-directory-enter
" DEL " #' vertico-directory-delete-char
2022-01-10 02:52:07 +00:00
" M-DEL " #' vertico-directory-delete-word
2022-01-12 04:28:32 +00:00
" TAB " #' +vertico-widen-or-complete
" M-j " #' vertico-quick-insert ) )
2021-12-29 00:20:07 +00:00
( add-hook 'rfn-eshadow-update-overlay-hook #' vertico-directory-tidy ) )
2021-09-04 15:38:06 +00:00
2021-10-02 00:06:13 +00:00
( setup ( :straight visual-fill-column )
2021-12-26 19:03:24 +00:00
( :option visual-fill-column-center-text t
( append reading-modes ) ' ( visual-fill-column-mode . +1 ) )
2021-12-29 00:20:07 +00:00
( :hook #' visual-line-mode )
2021-10-02 00:06:13 +00:00
( :hook-into org-mode )
2022-02-19 00:25:27 +00:00
( advice-add #' text-scale-adjust :after #' visual-fill-column-adjust )
( :global [ f12 ] #' visual-fill-column-mode ) )
2021-09-04 15:38:06 +00:00
2021-12-18 00:31:24 +00:00
( setup ( :straight vlf )
( :require vlf-setup ) )
2022-04-20 03:27:03 +00:00
( setup ( :straight vterm
( and module-file-suffix
( executable-find " cmake " ) )
:quit )
( :also-load +vterm )
( :option vterm-always-compile-module t
vterm-buffer-name-string " vterm: %s "
vterm-max-scrollback 100000 ; max allowed by vterm-module.h
)
( advice-add 'counsel-yank-pop-action :around
#' +vterm-counsel-yank-pop-action ) )
2022-04-12 18:19:16 +00:00
( setup ( :straight ( vundo
:host github
:repo " casouri/vundo " ) ) )
2022-01-16 04:05:50 +00:00
( setup ( :straight web-mode )
( setf ( alist-get ( rx " . " ( or " htm " " html " " phtml " " tpl.php "
" asp " " gsp " " jsp " " ascx " " aspx "
" erb " " mustache " " djhtml " )
eos )
auto-mode-alist )
'web-mode )
( with-eval-after-load 'apheleia
( setf ( alist-get 'web-mode apheleia-mode-alist )
'prettier ) ) )
2021-09-04 15:38:06 +00:00
( setup ( :straight whitespace-cleanup-mode )
2022-01-04 06:40:50 +00:00
( :option whitespace-cleanup-mode-preserve-point t
whitespace-cleanup-mode-only-if-initially-clean nil )
2021-09-04 15:38:06 +00:00
( global-whitespace-cleanup-mode +1 ) )
2021-12-05 05:09:33 +00:00
2022-01-05 17:23:26 +00:00
( setup ( :straight wrap-region )
( :require wrap-region )
( wrap-region-add-wrappers
' ( ( " * " " * " nil org-mode )
( " ~ " " ~ " nil org-mode )
( " / " " / " nil org-mode )
( " = " " = " nil org-mode )
( " + " " + " nil org-mode )
( " _ " " _ " nil org-mode )
( " $ " " $ " nil ( org-mode latex-mode ) ) ) )
( :hook-into org-mode
latex-mode ) )
2022-02-07 04:17:56 +00:00
( setup ( :straight xkcd )
( :also-load +xkcd )
( :hook #' visual-fill-column-mode ) )
2022-04-27 13:38:03 +00:00
( setup ( :straight xr ) )
2022-02-08 20:16:36 +00:00
( setup ( :straight yaoddmuse ) )
2022-01-10 05:58:04 +00:00
( setup ( :straight yasnippet )
( :option yas-snippet-dirs ( list
( expand-file-name " snippets " user-emacs-directory )
( sync/ " emacs/snippets " t ) ) )
( yas-global-mode +1 ) )
2022-01-17 07:10:01 +00:00
( setup ( :straight ( ytdious
2022-01-17 19:45:32 +00:00
:host github :repo " spiderbit/ytdious "
2022-01-17 07:10:01 +00:00
:fork ( :host github :repo " duckwork/ytdious " ) ) )
( :also-load +ytdious )
( :option ytdious-invidious-api-url ( if +invidious-host
2022-01-17 19:45:32 +00:00
( concat " https:// " +invidious-host )
2022-01-17 07:10:01 +00:00
" https://invidious.snopyta.org " ) )
( :bind " y " #' +ytdious-watch ) )
2022-01-18 23:18:06 +00:00
2022-04-20 15:44:51 +00:00
( setup ( :straight zoom-frm )
( :+key " M-+ " #' zoom-frm-in
2022-04-24 20:03:04 +00:00
" M-_ " #' zoom-frm-out ) )
2022-01-18 23:18:06 +00:00
( setup ( :straight zzz-to-char )
( :require +zzz-to-char )
( :option zzz-to-char-reach ( +bytes 1 :kib ) )
( :global " M-z " #' +zzz-to-char ) )