bb42550b2899f1e87dd8cea0c0dc4456e8dc7fee
[~bandali/configs] / init.el
1 ;;; init.el --- bandali's emacs configuration -*- lexical-binding: t -*-
2
3 ;; Copyright (C) 2018-2020 Amin Bandali <bandali@gnu.org>
4
5 ;; This program is free software: you can redistribute it and/or modify
6 ;; it under the terms of the GNU General Public License as published by
7 ;; the Free Software Foundation, either version 3 of the License, or
8 ;; (at your option) any later version.
9
10 ;; This program is distributed in the hope that it will be useful,
11 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ;; GNU General Public License for more details.
14
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with this program. If not, see <https://www.gnu.org/licenses/>.
17
18 ;;; Commentary:
19
20 ;; GNU Emacs configuration of Amin Bandali, computer scientist,
21 ;; Free Software activist, and GNU maintainer & webmaster. Packages
22 ;; are installed through using Borg for a fully reproducible setup.
23
24 ;; Over the years, I've taken inspiration from configurations of many
25 ;; great people. Some that I can remember off the top of my head are:
26 ;;
27 ;; - https://github.com/dieggsy/dotfiles
28 ;; - https://github.com/dakra/dmacs
29 ;; - http://pages.sachachua.com/.emacs.d/Sacha.html
30 ;; - https://github.com/dakrone/eos
31 ;; - http://doc.rix.si/cce/cce.html
32 ;; - https://github.com/jwiegley/dot-emacs
33 ;; - https://github.com/wasamasa/dotemacs
34 ;; - https://github.com/hlissner/doom-emacs
35
36 ;;; Code:
37
38 ;;; Emacs initialization
39
40 (defvar b/before-user-init-time (current-time)
41 "Value of `current-time' when Emacs begins loading `user-init-file'.")
42 (defvar b/emacs-initialized nil
43 "Whether Emacs has been initialized.")
44 (defvar b/exwm-p (string= (system-name) "chaman")
45 "Whether or not we will be using `exwm'.")
46
47 (when (not (bound-and-true-p b/emacs-initialized))
48 (message "Loading Emacs...done (%.3fs)"
49 (float-time (time-subtract b/before-user-init-time
50 before-init-time))))
51
52 ;; temporarily increase `gc-cons-threshhold' and `gc-cons-percentage'
53 ;; during startup to reduce garbage collection frequency. clearing
54 ;; `file-name-handler-alist' seems to help reduce startup time too.
55 (defvar b/gc-cons-threshold gc-cons-threshold)
56 (defvar b/gc-cons-percentage gc-cons-percentage)
57 (defvar b/file-name-handler-alist file-name-handler-alist)
58 (setq gc-cons-threshold (* 30 1024 1024) ; 30 MiB
59 gc-cons-percentage 0.6
60 file-name-handler-alist nil
61 ;; sidesteps a bug when profiling with esup
62 esup-child-profile-require-level 0)
63
64 ;; set them back to their defaults once we're done initializing
65 (defun b/post-init ()
66 "My post-initialize function, run after loading `user-init-file'."
67 (setq b/emacs-initialized t
68 gc-cons-threshold b/gc-cons-threshold
69 gc-cons-percentage b/gc-cons-percentage
70 file-name-handler-alist b/file-name-handler-alist)
71 (when b/exwm-p
72 (with-eval-after-load 'exwm-workspace
73 (setq-default
74 mode-line-format
75 (append
76 mode-line-format
77 '((:eval
78 (format
79 "[%s]" (number-to-string
80 exwm-workspace-current-index)))))))))
81 (add-hook 'after-init-hook #'b/post-init)
82
83 ;; increase number of lines kept in *Messages* log
84 (setq message-log-max 20000)
85
86 ;; optionally, uncomment to supress some byte-compiler warnings
87 ;; (see C-h v byte-compile-warnings RET for more info)
88 ;; (setq byte-compile-warnings
89 ;; '(not free-vars unresolved noruntime lexical make-local))
90
91 \f
92 ;;; whoami
93
94 (setq user-full-name "Amin Bandali"
95 user-mail-address "bandali@gnu.org")
96
97 \f
98 ;;; comment macro
99
100 ;; useful for commenting out multiple sexps at a time
101 (defmacro comment (&rest _)
102 "Comment out one or more s-expressions."
103 (declare (indent defun))
104 nil)
105
106 \f
107 ;;; Package management
108
109 (progn ; `borg'
110 (add-to-list 'load-path
111 (expand-file-name "lib/borg" user-emacs-directory))
112 (require 'borg)
113 (borg-initialize)
114 (setq borg-rewrite-urls-alist
115 '(("git@github.com:" . "https://github.com/")
116 ("git@gitlab.com:" . "https://gitlab.com/"))))
117
118 ;; use-package
119 (if nil ; set to t when need to debug init
120 (progn
121 (setq use-package-verbose t
122 use-package-expand-minimally nil
123 use-package-compute-statistics t
124 debug-on-error t)
125 (require 'use-package))
126 (setq use-package-verbose nil
127 use-package-expand-minimally t))
128
129 (setq use-package-always-defer t)
130 (require 'bind-key)
131
132 \f
133 ;;; Initial setup
134
135 ;; keep ~/.emacs.d clean
136 (use-package no-littering
137 :demand
138 :config
139 (defalias 'b/etc 'no-littering-expand-etc-file-name)
140 (defalias 'b/var 'no-littering-expand-var-file-name))
141
142 (use-package auto-compile
143 :demand
144 :config
145 (auto-compile-on-load-mode)
146 (auto-compile-on-save-mode)
147 (setq auto-compile-display-buffer nil)
148 (setq auto-compile-mode-line-counter t)
149 (setq auto-compile-source-recreate-deletes-dest t)
150 (setq auto-compile-toggle-deletes-nonlib-dest t)
151 (setq auto-compile-update-autoloads t))
152
153 ;; separate custom file (don't want it mixing with init.el)
154 (use-package custom
155 :no-require
156 :config
157 (setq custom-file (b/etc "custom.el"))
158 (when (file-exists-p custom-file)
159 (load custom-file))
160 ;; while at it, treat themes as safe
161 (setf custom-safe-themes t)
162 ;; only one custom theme at a time
163 (comment
164 (defadvice load-theme (before clear-previous-themes activate)
165 "Clear existing theme settings instead of layering them"
166 (mapc #'disable-theme custom-enabled-themes))))
167
168 ;; load the secrets file if it exists, otherwise show a warning
169 (comment
170 (with-demoted-errors
171 (load (b/etc "secrets"))))
172
173 ;; start up emacs server. see
174 ;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html#Emacs-Server
175 (use-package server
176 :defer 0.5
177 :config
178 (declare-function server-edit "server")
179 (bind-key "C-c F D" 'server-edit)
180 (declare-function server-running-p "server")
181 (or (server-running-p) (server-mode)))
182
183 \f
184 ;;; Useful utilities
185
186 (defmacro b/setq-every (value &rest vars)
187 "Set all the variables from VARS to value VALUE."
188 (declare (indent defun) (debug t))
189 `(progn ,@(mapcar (lambda (x) (list 'setq x value)) vars)))
190
191 (defun b/start-process (program &rest args)
192 "Same as `start-process', but doesn't bother about name and buffer."
193 (let ((process-name (concat program "_process"))
194 (buffer-name (generate-new-buffer-name
195 (concat program "_output"))))
196 (apply #'start-process
197 process-name buffer-name program args)))
198
199 (defun b/dired-start-process (program &optional args)
200 "Open current file with a PROGRAM."
201 ;; Shell command looks like this: "program [ARGS]... FILE" (ARGS can
202 ;; be nil, so remove it).
203 (declare-function dired-get-file-for-visit "dired")
204 (apply #'b/start-process
205 program
206 (remove nil (list args (dired-get-file-for-visit)))))
207
208 (defun b/add-elisp-section ()
209 (interactive)
210 (insert "\n")
211 (forward-line -1)
212 (insert "\n\f\n;;; "))
213
214 ;; (defvar b/fill-column 47
215 ;; "My custom `fill-column'.")
216
217 (defconst b/asterism "* * *")
218
219 (defun b/insert-asterism ()
220 "Insert a centred asterism."
221 (interactive)
222 (insert
223 (concat
224 "\n\n"
225 (make-string (floor (/ (- fill-column (length b/asterism)) 2))
226 ?\s)
227 b/asterism
228 "\n\n")))
229
230 (defun b/no-mouse-autoselect-window ()
231 "Conveniently disable `focus-follows-mouse'.
232 For disabling the behaviour for certain buffers and/or modes."
233 (make-local-variable 'mouse-autoselect-window)
234 (setq mouse-autoselect-window nil))
235
236 (defun b/kill-current-buffer ()
237 "Kill the current buffer."
238 ;; also see https://redd.it/64xb3q
239 (interactive)
240 (kill-buffer (current-buffer)))
241
242 (defun b/move-indentation-or-beginning-of-line (arg)
243 "Move to the indentation or to the beginning of line."
244 (interactive "^p")
245 ;; (if (bolp)
246 ;; (back-to-indentation)
247 ;; (move-beginning-of-line arg))
248 (if (= (point)
249 (progn (back-to-indentation)
250 (point)))
251 (move-beginning-of-line arg)))
252
253 (defun b/join-line-top ()
254 "Like `join-line', but join next line to the current line."
255 (interactive)
256 (join-line 1))
257
258 (defun b/duplicate-line-or-region (&optional n)
259 "Duplicate the current line, or region (if active).
260 Make N (default: 1) copies of the current line or region."
261 (interactive "*p")
262 (let ((u-r-p (use-region-p)) ; if region is active
263 (n1 (or n 1)))
264 (save-excursion
265 (let ((text
266 (if u-r-p
267 (buffer-substring (region-beginning) (region-end))
268 (prog1 (thing-at-point 'line)
269 (end-of-line)
270 (if (eobp)
271 (newline)
272 (forward-line 1))))))
273 (dotimes (_ (abs n1))
274 (insert text))))))
275
276 \f
277 ;;; Defaults
278
279 ;;;; C-level customizations
280
281 (setq
282 ;; minibuffer
283 enable-recursive-minibuffers t
284 resize-mini-windows t
285 ;; more useful frame titles
286 frame-title-format '("" invocation-name " - "
287 (:eval
288 (if (buffer-file-name)
289 (abbreviate-file-name (buffer-file-name))
290 "%b")))
291 ;; i don't feel like jumping out of my chair every now and again; so
292 ;; don't BEEP! at me, emacs
293 ring-bell-function 'ignore
294 ;; better scrolling
295 ;; scroll-margin 1
296 ;; scroll-conservatively 10000
297 scroll-step 1
298 scroll-conservatively 101
299 scroll-preserve-screen-position 1
300 ;; focus follows mouse
301 mouse-autoselect-window t)
302
303 (setq-default
304 ;; always use space for indentation
305 indent-tabs-mode nil
306 tab-width 4
307 ;; cursor shape
308 cursor-type t)
309
310 ;; unicode support
311 (comment
312 (dolist (ft (fontset-list))
313 (set-fontset-font
314 ft
315 'unicode
316 (font-spec :name "Source Code Pro" :size 14))
317 (set-fontset-font
318 ft
319 'unicode
320 (font-spec :name "DejaVu Sans Mono")
321 nil
322 'append)
323 ;; (set-fontset-font
324 ;; ft
325 ;; 'unicode
326 ;; (font-spec
327 ;; :name "Symbola monospacified for DejaVu Sans Mono")
328 ;; nil
329 ;; 'append)
330 ;; (set-fontset-font
331 ;; ft
332 ;; #x2115 ; ℕ
333 ;; (font-spec :name "DejaVu Sans Mono")
334 ;; nil
335 ;; 'append)
336 (set-fontset-font
337 ft
338 (cons ?Α ?ω)
339 (font-spec :name "DejaVu Sans Mono" :size 14)
340 nil
341 'prepend)))
342
343 ;;;; Elisp-level customizations
344
345 (use-package startup
346 :no-require
347 :demand
348 :config
349 ;; don't need to see the startup echo area message
350 (advice-add #'display-startup-echo-area-message :override #'ignore)
351 :custom
352 ;; i want *scratch* as my startup buffer
353 (initial-buffer-choice t)
354 ;; i don't need the default hint
355 (initial-scratch-message nil)
356 ;; use customizable text-mode as major mode for *scratch*
357 ;; (initial-major-mode 'text-mode)
358 ;; inhibit buffer list when more than 2 files are loaded
359 (inhibit-startup-buffer-menu t)
360 ;; don't need to see the startup screen or echo area message
361 (inhibit-startup-screen t)
362 (inhibit-startup-echo-area-message user-login-name))
363
364 (use-package files
365 :no-require
366 :demand
367 :custom
368 ;; backups (C-h v make-backup-files RET)
369 (backup-by-copying t)
370 (version-control t)
371 (delete-old-versions t)
372
373 ;; auto-save
374 (auto-save-file-name-transforms
375 `((".*" ,(b/var "auto-save/") t)))
376
377 ;; insert newline at the end of files
378 (require-final-newline t)
379
380 ;; open read-only file buffers in view-mode
381 ;; (enables niceties like `q' for quit)
382 (view-read-only t))
383
384 ;; disable disabled commands
385 (setq disabled-command-function nil)
386
387 ;; lazy-person-friendly yes/no prompts
388 (defalias 'yes-or-no-p #'y-or-n-p)
389
390 ;; enable automatic reloading of changed buffers and files
391 (use-package autorevert
392 :demand
393 :config
394 (global-auto-revert-mode 1)
395 :custom
396 (auto-revert-verbose nil)
397 (global-auto-revert-non-file-buffers nil))
398
399 ;; time and battery in mode-line
400 (use-package time
401 :demand
402 :config
403 (display-time-mode)
404 :custom
405 (display-time-default-load-average nil)
406 (display-time-format " %a %b %-e %-l:%M%P")
407 (display-time-mail-icon '(image :type xpm :file "gnus/gnus-pointer.xpm" :ascent center))
408 (display-time-use-mail-icon t))
409
410 (use-package battery
411 :demand
412 :config
413 (display-battery-mode)
414 :custom
415 (battery-mode-line-format "%p%% %t"))
416
417 (use-package fringe
418 :demand
419 :config
420 ;; smaller fringe
421 ;; (fringe-mode '(3 . 1))
422 (fringe-mode nil))
423
424 (use-package winner
425 :demand
426 :config
427 ;; enable winner-mode (C-h f winner-mode RET)
428 (winner-mode 1))
429
430 (use-package compile
431 :config
432 ;; don't display *compilation* buffer on success. based on
433 ;; https://stackoverflow.com/a/17788551, with changes to use `cl-letf'
434 ;; instead of the now obsolete `flet'.
435 (defun b/compilation-finish-function (buffer outstr)
436 (unless (string-match "finished" outstr)
437 (switch-to-buffer-other-window buffer))
438 t)
439
440 (setq compilation-finish-functions #'b/compilation-finish-function)
441
442 (require 'cl-macs)
443
444 (defadvice compilation-start
445 (around inhibit-display
446 (command &optional mode name-function highlight-regexp))
447 (if (not (string-match "^\\(find\\|grep\\)" command))
448 (cl-letf (((symbol-function 'display-buffer) #'ignore))
449 (save-window-excursion ad-do-it))
450 ad-do-it))
451 (ad-activate 'compilation-start))
452
453 (use-package isearch
454 :custom
455 ;; allow scrolling in Isearch
456 (isearch-allow-scroll t)
457 ;; search for non-ASCII characters: i’d like non-ASCII characters such
458 ;; as ‘’“”«»‹›áⓐ𝒶 to be selected when i search for their ASCII
459 ;; counterpart. shoutout to
460 ;; http://endlessparentheses.com/new-in-emacs-25-1-easily-search-non-ascii-characters.html
461 (search-default-mode #'char-fold-to-regexp))
462
463 ;; uncomment to extend the above behaviour to query-replace
464 (comment
465 (use-package replace
466 :custom
467 (replace-char-fold t)))
468
469 (use-package vc
470 :bind ("C-x v C-=" . vc-ediff))
471
472 (use-package vc-git
473 :after vc
474 :custom
475 (vc-git-print-log-follow t))
476
477 (use-package ediff
478 :config (add-hook 'ediff-after-quit-hook-internal 'winner-undo)
479 :custom ((ediff-window-setup-function 'ediff-setup-windows-plain)
480 (ediff-split-window-function 'split-window-horizontally)))
481
482 (use-package face-remap
483 :custom
484 ;; gentler font resizing
485 (text-scale-mode-step 1.05))
486
487 (use-package mwheel
488 :defer 0.4
489 :config
490 (setq mouse-wheel-scroll-amount '(1 ((shift) . 1)) ; one line at a time
491 mouse-wheel-progressive-speed nil ; don't accelerate scrolling
492 mouse-wheel-follow-mouse t)) ; scroll window under mouse
493
494 (use-package pixel-scroll
495 :defer 0.4
496 :config (pixel-scroll-mode 1))
497
498 (use-package epg-config
499 :config
500 ;; ask for GPG passphrase in minibuffer
501 ;; this will fail if gpg>=2.1 is not available
502 (setq epg-pinentry-mode 'loopback)
503 :custom
504 (epg-gpg-program (executable-find "gpg")))
505
506 (use-package epg
507 :after epg-config)
508
509 (use-package pinentry
510 :disabled
511 :demand
512 :after (epa epg server)
513 :config
514 ;; workaround for systemd-based distros:
515 ;; (setq pinentry--socket-dir server-socket-dir)
516 (pinentry-start))
517
518 (use-package auth-source
519 :custom
520 (auth-sources '("~/.authinfo.gpg"))
521 (authinfo-hidden (regexp-opt '("password" "client-secret" "token"))))
522
523 \f
524 ;;; General bindings
525
526 (bind-keys
527 ("C-a" . b/move-indentation-or-beginning-of-line)
528 ("C-c a i" . ielm)
529 ("C-c d" . b/duplicate-line-or-region)
530
531 ("C-c e b" . eval-buffer)
532 ("C-c e e" . eval-last-sexp)
533 ("C-c e p" . pp-macroexpand-last-sexp)
534 ("C-c e r" . eval-region)
535
536 ("C-c e i" . emacs-init-time)
537 ("C-c e u" . emacs-uptime)
538 ("C-c e v" . emacs-version)
539
540 ("C-c f ." . find-file)
541 ("C-c f d" . find-name-dired)
542 ("C-c f l" . find-library)
543
544 ("C-c F m" . make-frame-command)
545 ("C-c F d" . delete-frame)
546
547 ("C-S-h C" . describe-char)
548 ("C-S-h F" . describe-face)
549
550 ("C-S-j" . b/join-line-top)
551
552 ("C-c x" . execute-extended-command)
553
554 ("C-x k" . b/kill-current-buffer)
555 ("C-x K" . kill-buffer)
556 ("C-x s" . save-buffer)
557 ("C-x S" . save-some-buffers)
558
559 :map emacs-lisp-mode-map
560 ("<C-return>" . b/add-elisp-section))
561
562 (when (display-graphic-p)
563 (unbind-key "C-z" global-map))
564
565 (bind-keys
566 ;; for back and forward mouse keys
567 ("<XF86Back>" . previous-buffer)
568 ("<mouse-8>" . previous-buffer)
569 ;; ("<drag-mouse-8>" . previous-buffer)
570 ("<XF86Forward>" . next-buffer)
571 ("<mouse-9>" . next-buffer)
572 ;; ("<drag-mouse-9>" . next-buffer)
573 ;; ("<drag-mouse-2>" . kill-this-buffer)
574 ;; ("<drag-mouse-3>" . switch-to-buffer)
575 )
576
577 \f
578 ;;; Essential packages
579
580 (add-to-list
581 'load-path
582 (expand-file-name
583 (convert-standard-filename "lisp") user-emacs-directory))
584
585 (when b/exwm-p
586 (require 'bandali-exwm))
587
588 (require 'bandali-org)
589
590 ;; *the* right way to do git
591 (use-package magit
592 :bind (("C-x g" . magit-status)
593 ("C-c g g" . magit-status)
594 ("C-c g b" . magit-blame-addition)
595 ("C-c g l" . magit-log-buffer-file))
596 :config
597 (declare-function magit-add-section-hook "magit-section"
598 (hook function &optional at append local))
599 (magit-add-section-hook 'magit-status-sections-hook
600 'magit-insert-modules
601 'magit-insert-stashes
602 'append)
603 ;; (magit-add-section-hook 'magit-status-sections-hook
604 ;; 'magit-insert-ignored-files
605 ;; 'magit-insert-untracked-files
606 ;; 'append)
607 (setq magit-repository-directories '(("~/.emacs.d/" . 0)
608 ("~/src/git/" . 2)))
609 (nconc magit-section-initial-visibility-alist
610 '(([unpulled status] . show)
611 ([unpushed status] . show)))
612 (declare-function magit-display-buffer-fullframe-status-v1 "magit-mode" (buffer))
613 :custom
614 (magit-diff-refine-hunk t)
615 (magit-display-buffer-function #'magit-display-buffer-fullframe-status-v1)
616 ;; (magit-completing-read-function 'magit-ido-completing-read)
617 :custom-face (magit-diff-file-heading ((t (:weight normal)))))
618
619 ;; recently opened files
620 (use-package recentf
621 :defer 0.2
622 ;; :config
623 ;; (add-to-list 'recentf-exclude "^/\\(?:ssh\\|su\\|sudo\\)?:")
624 :config
625 (recentf-mode)
626 :custom
627 (recentf-max-saved-items 2000))
628
629 ;; needed for history for counsel
630 (use-package amx
631 :defer 0.3
632 :config
633 (amx-mode))
634
635 ;; (require 'bandali-ido)
636 (require 'bandali-ivy)
637
638 (require 'bandali-eshell)
639
640 (require 'bandali-ibuffer)
641
642 (use-package outline
643 :disabled
644 :hook (prog-mode . outline-minor-mode)
645 :bind
646 (:map
647 outline-minor-mode-map
648 ("<s-tab>" . outline-toggle-children)
649 ("M-p" . outline-previous-visible-heading)
650 ("M-n" . outline-next-visible-heading)
651 :prefix-map b/outline-prefix-map
652 :prefix "s-O"
653 ("TAB" . outline-toggle-children)
654 ("a" . outline-hide-body)
655 ("H" . outline-hide-body)
656 ("S" . outline-show-all)
657 ("h" . outline-hide-subtree)
658 ("s" . outline-show-subtree)))
659
660 (use-package ls-lisp
661 :custom (ls-lisp-dirs-first t))
662
663 (require 'bandali-dired)
664
665 (use-package help
666 :config
667 (temp-buffer-resize-mode)
668 (setq help-window-select t))
669
670 (use-package tramp
671 :config
672 (add-to-list 'tramp-default-proxies-alist '(nil "\\`root\\'" "/ssh:%h:"))
673 (add-to-list 'tramp-default-proxies-alist '("localhost" nil nil))
674 (add-to-list 'tramp-default-proxies-alist
675 (list (regexp-quote (system-name)) nil nil)))
676
677 (use-package doc-view
678 :bind (:map doc-view-mode-map
679 ("M-RET" . image-previous-line)))
680
681 ;; Email (with Gnus, message, and EBDB)
682 (require 'bandali-gnus)
683 (use-package sendmail
684 :config
685 (setq sendmail-program (executable-find "msmtp")
686 ;; message-sendmail-extra-arguments '("-v" "-d")
687 mail-specify-envelope-from t
688 mail-envelope-from 'header))
689 (require 'bandali-message)
690 (require 'bandali-ebdb)
691
692 ;; IRC (with ERC and ZNC)
693 (require 'bandali-erc)
694
695 (use-package scpaste
696 :config
697 (setq scpaste-http-destination "https://p.bndl.org"
698 scpaste-scp-destination "p:~"))
699
700 \f
701 ;;; Editing
702
703 ;; highlight uncommitted changes in the left fringe
704 (use-package diff-hl
705 :defer 0.6
706 :config
707 (setq diff-hl-draw-borders nil)
708 (global-diff-hl-mode)
709 :hook
710 ((magit-pre-refresh . diff-hl-magit-pre-refresh)
711 (magit-post-refresh . diff-hl-magit-post-refresh)))
712
713 ;; display Lisp objects at point in the echo area
714 (use-package eldoc
715 :when (version< "25" emacs-version)
716 :config (global-eldoc-mode))
717
718 ;; highlight matching parens
719 (use-package paren
720 :demand
721 :config (show-paren-mode))
722
723 (use-package elec-pair
724 :demand
725 :config (electric-pair-mode))
726
727 (use-package simple
728 :config (column-number-mode)
729 :custom
730 ;; Save what I copy into clipboard from other applications into Emacs'
731 ;; kill-ring, which would allow me to still be able to easily access
732 ;; it in case I kill (cut or copy) something else inside Emacs before
733 ;; yanking (pasting) what I'd originally intended to.
734 (save-interprogram-paste-before-kill t))
735
736 ;; save minibuffer history
737 (use-package savehist
738 :demand
739 :config
740 (savehist-mode)
741 (add-to-list 'savehist-additional-variables 'kill-ring))
742
743 ;; automatically save place in files
744 (use-package saveplace
745 :when (version< "25" emacs-version)
746 :config (save-place-mode))
747
748 (use-package prog-mode
749 :config (global-prettify-symbols-mode)
750 (defun indicate-buffer-boundaries-left ()
751 (setq indicate-buffer-boundaries 'left))
752 (add-hook 'prog-mode-hook #'indicate-buffer-boundaries-left))
753
754 (use-package text-mode
755 :bind (:map text-mode-map ("C-*" . b/insert-asterism))
756 :hook ((text-mode . indicate-buffer-boundaries-left)
757 (text-mode . flyspell-mode)))
758
759 (use-package conf-mode
760 :mode "\\.*rc$")
761
762 (use-package sh-script
763 :mode ("\\.bashrc$" . sh-mode))
764
765 (use-package company
766 :disabled
767 :bind
768 (:map company-active-map
769 ([tab] . company-complete-common-or-cycle)
770 ([escape] . company-abort)
771 ("C-p" . company-select-previous-or-abort)
772 ("C-n" . company-select-next-or-abort))
773 :custom
774 (company-minimum-prefix-length 1)
775 (company-selection-wrap-around t)
776 (company-dabbrev-char-regexp "\\sw\\|\\s_\\|[-_]")
777 (company-dabbrev-downcase nil)
778 (company-dabbrev-ignore-case nil)
779 ;; :config
780 ;; (global-company-mode t)
781 )
782
783 (use-package flycheck
784 :disabled
785 :defer 0.6
786 :hook (prog-mode . flycheck-mode)
787 :bind
788 (:map flycheck-mode-map
789 ("M-P" . flycheck-previous-error)
790 ("M-N" . flycheck-next-error))
791 :config
792 ;; Use the load-path from running Emacs when checking elisp files
793 (setq flycheck-emacs-lisp-load-path 'inherit)
794
795 ;; Only flycheck when I actually save the buffer
796 (setq flycheck-check-syntax-automatically '(mode-enabled save))
797 :custom (flycheck-mode-line-prefix "flyc"))
798
799 ;; (use-package flyspell)
800
801 ;; http://endlessparentheses.com/ispell-and-apostrophes.html
802 (use-package ispell
803 :disabled
804 :defer 0.6
805 :config
806 ;; ’ can be part of a word
807 (setq ispell-local-dictionary-alist
808 `((nil "[[:alpha:]]" "[^[:alpha:]]"
809 "['\x2019]" nil ("-B") nil utf-8))
810 ispell-program-name (executable-find "hunspell"))
811 ;; don't send ’ to the subprocess
812 (defun endless/replace-apostrophe (args)
813 (cons (replace-regexp-in-string
814 "’" "'" (car args))
815 (cdr args)))
816 (advice-add #'ispell-send-string :filter-args
817 #'endless/replace-apostrophe)
818
819 ;; convert ' back to ’ from the subprocess
820 (defun endless/replace-quote (args)
821 (if (not (derived-mode-p 'org-mode))
822 args
823 (cons (replace-regexp-in-string
824 "'" "’" (car args))
825 (cdr args))))
826 (advice-add #'ispell-parse-output :filter-args
827 #'endless/replace-quote))
828
829 (use-package abbrev
830 :hook (text-mode . abbrev-mode))
831
832 \f
833 ;;; Programming modes
834
835 (use-package lisp-mode
836 :config
837 (defun indent-spaces-mode ()
838 (setq indent-tabs-mode nil))
839 (add-hook 'lisp-interaction-mode-hook #'indent-spaces-mode))
840
841 (use-package alloy-mode
842 :mode "\\.\\(als\\|dsh\\)\\'"
843 :config
844 (setq alloy-basic-offset 2)
845 ;; (defun b/alloy-simple-indent (start end)
846 ;; (interactive "r")
847 ;; ;; (if (region-active-p)
848 ;; ;; (indent-rigidly start end alloy-basic-offset)
849 ;; ;; (if (bolp)
850 ;; ;; (indent-rigidly (line-beginning-position)
851 ;; ;; (line-end-position)
852 ;; ;; alloy-basic-offset)))
853 ;; (indent-to (+ (current-column) alloy-basic-offset)))
854 :bind (:map alloy-mode-map
855 ("RET" . electric-newline-and-maybe-indent)
856 ;; ("TAB" . b/alloy-simple-indent)
857 ("TAB" . indent-for-tab-command))
858 :hook (alloy-mode . (lambda () (setq-local indent-tabs-mode nil))))
859
860 (use-package lean-mode
861 :disabled
862 :defer 0.4
863 :init (eval-when-compile (defvar lean-mode-map))
864 :bind (:map lean-mode-map
865 ("S-SPC" . company-complete))
866 :config
867 (require 'lean-input)
868 (setq default-input-method "Lean"
869 lean-input-tweak-all '(lean-input-compose
870 (lean-input-prepend "/")
871 (lean-input-nonempty))
872 lean-input-user-translations '(("/" "/")))
873 (lean-input-setup))
874
875 (use-package sgml-mode
876 :config
877 (setq sgml-basic-offset 0))
878
879 (use-package css-mode
880 :config
881 (setq css-indent-offset 2))
882
883 (use-package emmet-mode
884 :after (:any mhtml-mode css-mode sgml-mode)
885 :bind* (("C-)" . emmet-next-edit-point)
886 ("C-(" . emmet-prev-edit-point))
887 :config
888 (unbind-key "C-j" emmet-mode-keymap)
889 (setq emmet-move-cursor-between-quotes t)
890 :hook (css-mode html-mode sgml-mode))
891
892 (use-package geiser
893 :disabled)
894
895 (use-package geiser-guile
896 :disabled
897 :config
898 (setq geiser-guile-load-path "~/src/git/guix"))
899
900 (use-package guix
901 :disabled)
902
903 (use-package go-mode
904 :disabled)
905
906 (use-package po-mode
907 :disabled
908 :hook
909 (po-mode . (lambda () (run-with-timer 0.1 nil 'View-exit))))
910
911 (use-package auctex
912 :disabled
913 :custom
914 (font-latex-fontify-sectioning 'color))
915
916 (use-package tex-mode
917 :config
918 (cl-delete-if
919 (lambda (p) (string-match "^---?" (car p)))
920 tex--prettify-symbols-alist)
921 :hook ((tex-mode . auto-fill-mode)
922 (tex-mode . flyspell-mode)))
923
924 ;; (use-package george-mode
925 ;; :straight (:host nil :repo "https://git.shemshak.org/amin/george-mode")
926 ;; :mode "\\.grg\\'")
927
928 \f
929 ;;; Theme
930
931 (comment
932 (add-to-list 'custom-theme-load-path
933 (expand-file-name
934 (convert-standard-filename "lisp") user-emacs-directory))
935 (load-theme 'tangomod t)
936
937 (use-package smart-mode-line
938 :commands (sml/apply-theme)
939 :demand
940 :config
941 ;; thanks, but no thnaks; don't make fixed-width fills.
942 (defun sml/fill-for-buffer-identification () "")
943 (setq sml/theme 'tangomod)
944 (sml/setup)
945 (smart-mode-line-enable))
946
947 (use-package doom-modeline
948 :disabled
949 :demand
950 :hook (after-init . doom-modeline-init)
951 :custom
952 (doom-modeline-buffer-file-name-style 'relative-to-project))
953
954 (use-package doom-themes)
955
956 (use-package moody
957 :disabled
958 :demand
959 :config
960 (setq x-underline-at-descent-line t)
961 (let ((line (face-attribute 'mode-line :underline)))
962 (set-face-attribute 'mode-line nil :overline line)
963 (set-face-attribute 'mode-line-inactive nil :overline line)
964 (set-face-attribute 'mode-line-inactive nil :underline line)
965 (set-face-attribute 'mode-line nil :box nil)
966 (set-face-attribute 'mode-line-inactive nil :box nil)
967 (set-face-attribute 'mode-line-inactive nil :background "#e1e1e1")) ; d3d7cf
968 (moody-replace-mode-line-buffer-identification)
969 (moody-replace-vc-mode))
970
971 (use-package mini-modeline
972 :disabled
973 :demand
974 :config (mini-modeline-mode))
975
976 (defvar b/org-mode-font-lock-keywords
977 '(("[ \t]*\\(#\\+\\(BEGIN\\|END\\|begin\\|end\\)_\\(\\S-+\\)\\)[ \t]*\\([^\n:]*\\)"
978 (1 '(:foreground "#5a5b5a" :background "#292b2b") t) ; directive
979 (3 '(:foreground "#81a2be" :background "#292b2b") t) ; kind
980 (4 '(:foreground "#c5c8c6") t))) ; title
981 "For use with the `doom-tomorrow-night' theme.")
982
983 (defun b/lights-on ()
984 "Enable my favourite light theme."
985 (interactive)
986 (mapc #'disable-theme custom-enabled-themes)
987 (load-theme 'tangomod t)
988 (when (featurep 'smart-mode-line)
989 (sml/apply-theme 'tangomod))
990 (font-lock-remove-keywords
991 'org-mode b/org-mode-font-lock-keywords)
992 (when (featurep 'erc-hl-nicks)
993 (erc-hl-nicks-reset-face-table))
994 (when (featurep 'exwm-systemtray)
995 (exwm-systemtray--refresh)))
996
997 (defun b/lights-off ()
998 "Go dark."
999 (interactive)
1000 (mapc #'disable-theme custom-enabled-themes)
1001 (load-theme 'doom-one t)
1002 (when (featurep 'smart-mode-line)
1003 (sml/apply-theme 'automatic))
1004 (font-lock-add-keywords
1005 'org-mode b/org-mode-font-lock-keywords t)
1006 (when (featurep 'erc-hl-nicks)
1007 (erc-hl-nicks-reset-face-table))
1008 (when (featurep 'exwm-systemtray)
1009 (exwm-systemtray--refresh)))
1010
1011 (bind-keys
1012 ("C-c t d" . b/lights-off)
1013 ("C-c t l" . b/lights-on))
1014
1015 \f
1016 ;;; Emacs enhancements & auxiliary packages
1017
1018 (use-package man
1019 :config (setq Man-width 80))
1020
1021 (use-package which-key
1022 :defer 0.4
1023 :config
1024 (which-key-add-key-based-replacements
1025 ;; prefixes for global prefixes and minor modes
1026 "C-c @" "outline"
1027 "C-c !" "flycheck"
1028 "C-x RET" "coding system"
1029 "C-x 8" "unicode"
1030 "C-x @" "event modifiers"
1031 "C-x a" "abbrev/expand"
1032 "C-x r" "rectangle/register/bookmark"
1033 "C-x t" "tabs"
1034 "C-x v" "version control"
1035 "C-x X" "edebug"
1036 "C-x C-a" "edebug"
1037 "C-x C-k" "kmacro"
1038 ;; prefixes for my personal bindings
1039 "C-c &" "yasnippet"
1040 "C-c a" "applications"
1041 "C-c a e" "erc"
1042 "C-c a o" "org"
1043 "C-c a s" "shells"
1044 "C-c b" "buffers"
1045 "C-c c" "compile-and-comments"
1046 "C-c e" "eval"
1047 "C-c f" "files"
1048 "C-c F" "frames"
1049 "C-c g" "magit"
1050 "C-S-h" "help(ful)"
1051 "C-c m" "multiple-cursors"
1052 "C-c p" "projectile"
1053 "C-c p s" "projectile/search"
1054 "C-c p x" "projectile/execute"
1055 "C-c p 4" "projectile/other-window"
1056 "C-c q" "boxquote"
1057 "C-c t" "themes"
1058 ;; "s-O" "outline"
1059 )
1060
1061 ;; prefixes for major modes
1062 (which-key-add-major-mode-key-based-replacements 'message-mode
1063 "C-c f n" "footnote")
1064 (which-key-add-major-mode-key-based-replacements 'org-mode
1065 "C-c C-v" "org-babel")
1066
1067 (which-key-mode)
1068 :custom
1069 (which-key-add-column-padding 5)
1070 (which-key-max-description-length 32))
1071
1072 (use-package crux ; results in Waiting for git... [2 times]
1073 :defer 0.4
1074 :bind (("C-c d" . crux-duplicate-current-line-or-region)
1075 ("C-c M-d" . crux-duplicate-and-comment-current-line-or-region)
1076 ("C-c f C" . crux-copy-file-preserve-attributes)
1077 ("C-c f D" . crux-delete-file-and-buffer)
1078 ("C-c f R" . crux-rename-file-and-buffer)
1079 ("C-c j" . crux-top-join-line)
1080 ("C-S-j" . crux-top-join-line)))
1081
1082 (use-package projectile
1083 :disabled
1084 :defer 0.5
1085 :bind-keymap ("C-c p" . projectile-command-map)
1086 :config
1087 (projectile-mode)
1088
1089 (defun b/projectile-mode-line-fun ()
1090 "Report project name and type in the modeline."
1091 (let ((project-name (projectile-project-name))
1092 (project-type (projectile-project-type)))
1093 (format "%s%s"
1094 projectile-mode-line-prefix
1095 (if project-type
1096 (format ":%s" project-type)
1097 ""))))
1098 (setq projectile-mode-line-function 'b/projectile-mode-line-fun)
1099
1100 (defun my-projectile-invalidate-cache (&rest _args)
1101 ;; ignore the args to `magit-checkout'
1102 (projectile-invalidate-cache nil))
1103
1104 (eval-after-load 'magit-branch
1105 '(progn
1106 (advice-add 'magit-checkout
1107 :after #'my-projectile-invalidate-cache)
1108 (advice-add 'magit-branch-and-checkout
1109 :after #'my-projectile-invalidate-cache)))
1110 :custom
1111 (projectile-completion-system 'ivy)
1112 (projectile-mode-line-prefix " proj"))
1113
1114 (use-package helpful
1115 :defer 0.6
1116 :bind
1117 (("C-S-h c" . helpful-command)
1118 ("C-S-h f" . helpful-callable) ; helpful-function
1119 ("C-S-h v" . helpful-variable)
1120 ("C-S-h k" . helpful-key)
1121 ("C-S-h p" . helpful-at-point)))
1122
1123 (use-package unkillable-scratch
1124 :defer 0.6
1125 :config
1126 (unkillable-scratch 1)
1127 :custom
1128 (unkillable-buffers '("^\\*scratch\\*$" "^\\*Messages\\*$")))
1129
1130 ;; ,----
1131 ;; | make pretty boxed quotes like this
1132 ;; `----
1133 (use-package boxquote
1134 :defer 0.6
1135 :bind
1136 (:prefix-map b/boxquote-prefix-map
1137 :prefix "C-c q"
1138 ("b" . boxquote-buffer)
1139 ("B" . boxquote-insert-buffer)
1140 ("d" . boxquote-defun)
1141 ("F" . boxquote-insert-file)
1142 ("hf" . boxquote-describe-function)
1143 ("hk" . boxquote-describe-key)
1144 ("hv" . boxquote-describe-variable)
1145 ("hw" . boxquote-where-is)
1146 ("k" . boxquote-kill)
1147 ("p" . boxquote-paragraph)
1148 ("q" . boxquote-boxquote)
1149 ("r" . boxquote-region)
1150 ("s" . boxquote-shell-command)
1151 ("t" . boxquote-text)
1152 ("T" . boxquote-title)
1153 ("u" . boxquote-unbox)
1154 ("U" . boxquote-unbox-region)
1155 ("y" . boxquote-yank)
1156 ("M-q" . boxquote-fill-paragraph)
1157 ("M-w" . boxquote-kill-ring-save)))
1158
1159 (use-package orgalist
1160 ;; breaks auto-fill-mode, showing this error:
1161 ;; orgalist--boundaries: Lisp nesting exceeds ‘max-lisp-eval-depth’
1162 :disabled
1163 :after message
1164 :hook (message-mode . orgalist-mode))
1165
1166 ;; highlight TODOs in buffers
1167 (use-package hl-todo
1168 :defer 0.5
1169 :config
1170 (global-hl-todo-mode))
1171
1172 (use-package multi-term
1173 :disabled
1174 :defer 0.6
1175 :bind (("C-c a s m m" . multi-term)
1176 ("C-c a s m d" . multi-term-dedicated-toggle)
1177 ("C-c a s m p" . multi-term-prev)
1178 ("C-c a s m n" . multi-term-next)
1179 :map term-mode-map
1180 ("C-c C-j" . term-char-mode))
1181 :config
1182 (setq multi-term-program "screen"
1183 multi-term-program-switches (concat "-c"
1184 (getenv "XDG_CONFIG_HOME")
1185 "/screen/screenrc")
1186 ;; TODO: add separate bindings for connecting to existing
1187 ;; session vs. always creating a new one
1188 multi-term-dedicated-select-after-open-p t
1189 multi-term-dedicated-window-height 20
1190 multi-term-dedicated-max-window-height 30
1191 term-bind-key-alist
1192 '(("C-c C-c" . term-interrupt-subjob)
1193 ("C-c C-e" . term-send-esc)
1194 ("C-c C-j" . term-line-mode)
1195 ("C-k" . kill-line)
1196 ;; ("C-y" . term-paste)
1197 ("C-y" . term-send-raw)
1198 ("M-f" . term-send-forward-word)
1199 ("M-b" . term-send-backward-word)
1200 ("M-p" . term-send-up)
1201 ("M-n" . term-send-down)
1202 ("M-j" . term-send-raw-meta)
1203 ("M-y" . term-send-raw-meta)
1204 ("M-/" . term-send-raw-meta)
1205 ("M-0" . term-send-raw-meta)
1206 ("M-1" . term-send-raw-meta)
1207 ("M-2" . term-send-raw-meta)
1208 ("M-3" . term-send-raw-meta)
1209 ("M-4" . term-send-raw-meta)
1210 ("M-5" . term-send-raw-meta)
1211 ("M-6" . term-send-raw-meta)
1212 ("M-7" . term-send-raw-meta)
1213 ("M-8" . term-send-raw-meta)
1214 ("M-9" . term-send-raw-meta)
1215 ("<C-backspace>" . term-send-backward-kill-word)
1216 ("<M-DEL>" . term-send-backward-kill-word)
1217 ("M-d" . term-send-delete-word)
1218 ("M-," . term-send-raw)
1219 ("M-." . comint-dynamic-complete))
1220 term-unbind-key-alist
1221 '("C-z" "C-x" "C-c" "C-h"
1222 ;; "C-y"
1223 "<ESC>")))
1224
1225 (use-package page-break-lines
1226 :defer 0.5
1227 :custom
1228 (page-break-lines-max-width fill-column)
1229 :config
1230 (global-page-break-lines-mode))
1231
1232 (use-package expand-region
1233 :bind ("C-=" . er/expand-region))
1234
1235 (use-package multiple-cursors
1236 :bind
1237 (("C-S-<mouse-1>" . mc/add-cursor-on-click)
1238 (:prefix-map b/mc-prefix-map
1239 :prefix "C-c m"
1240 ("c" . mc/edit-lines)
1241 ("n" . mc/mark-next-like-this)
1242 ("p" . mc/mark-previous-like-this)
1243 ("a" . mc/mark-all-like-this))))
1244
1245 (use-package yasnippet
1246 :defer 0.6
1247 :config
1248 (defconst yas-verbosity-cur yas-verbosity)
1249 (setq yas-verbosity 2)
1250 (add-to-list 'yas-snippet-dirs "~/src/git/guix/etc/snippets" t)
1251 (yas-reload-all)
1252 (setq yas-verbosity yas-verbosity-cur)
1253
1254 (defun b/yas--maybe-expand-key-filter (cmd)
1255 (when (and (yas--maybe-expand-key-filter cmd)
1256 (not (bound-and-true-p git-commit-mode)))
1257 cmd))
1258 (defconst b/yas-maybe-expand
1259 '(menu-item "" yas-expand :filter b/yas--maybe-expand-key-filter))
1260 (define-key yas-minor-mode-map
1261 (kbd "SPC") b/yas-maybe-expand)
1262
1263 (yas-global-mode))
1264
1265 (use-package debbugs
1266 :bind
1267 (("C-c D d" . debbugs-gnu)
1268 ("C-c D b" . debbugs-gnu-bugs)
1269 ("C-c D e" .
1270 (lambda ()
1271 (interactive) ; bug-gnu-emacs
1272 (setq debbugs-gnu-current-suppress t)
1273 (debbugs-gnu debbugs-gnu-default-severities '("emacs"))))
1274 ("C-c D g" . ; bug-gnuzilla
1275 (lambda ()
1276 (interactive)
1277 (setq debbugs-gnu-current-suppress t)
1278 (debbugs-gnu debbugs-gnu-default-severities '("gnuzilla"))))
1279 ("C-c D G b" . ; bug-guix
1280 (lambda ()
1281 (interactive)
1282 (setq debbugs-gnu-current-suppress t)
1283 (debbugs-gnu debbugs-gnu-default-severities '("guix"))))
1284 ("C-c D G p" . ; guix-patches
1285 (lambda ()
1286 (interactive)
1287 (setq debbugs-gnu-current-suppress t)
1288 (debbugs-gnu debbugs-gnu-default-severities '("guix-patches"))))))
1289
1290 (use-package org-ref
1291 :init
1292 (b/setq-every '("~/usr/org/references.bib")
1293 reftex-default-bibliography
1294 org-ref-default-bibliography)
1295 (setq
1296 org-ref-bibliography-notes "~/usr/org/notes.org"
1297 org-ref-pdf-directory "~/usr/org/bibtex-pdfs/"))
1298
1299 ;; (use-package fill-column-indicator)
1300
1301 (use-package window
1302 :bind
1303 (("C-c w s l" . (lambda ()
1304 (interactive)
1305 (split-window-right)
1306 (other-window 1)))
1307 ("C-c w s j" . (lambda ()
1308 (interactive)
1309 (split-window-below)
1310 (other-window 1)))
1311 ("C-c w q" . quit-window))
1312 :custom
1313 (split-width-threshold 150))
1314
1315 (use-package windmove
1316 :defer 0.6
1317 :bind
1318 (("C-c w h" . windmove-left)
1319 ("C-c w j" . windmove-down)
1320 ("C-c w k" . windmove-up)
1321 ("C-c w l" . windmove-right)
1322 ("C-c w H" . windmove-swap-states-left)
1323 ("C-c w J" . windmove-swap-states-down)
1324 ("C-c w K" . windmove-swap-states-up)
1325 ("C-c w L" . windmove-swap-states-right)))
1326
1327 (use-package pass
1328 :commands pass
1329 :bind ("C-c a p" . pass)
1330 :hook (pass-mode . View-exit))
1331
1332 (use-package pdf-tools
1333 :defer 0.5
1334 :bind (:map pdf-view-mode-map
1335 ("<C-XF86Back>" . pdf-history-backward)
1336 ("<mouse-8>" . pdf-history-backward)
1337 ("<drag-mouse-8>" . pdf-history-backward)
1338 ("<C-XF86Forward>" . pdf-history-forward)
1339 ("<mouse-9>" . pdf-history-forward)
1340 ("<drag-mouse-9>" . pdf-history-forward)
1341 ("M-RET" . image-previous-line)
1342 ("C-s" . isearch-forward)
1343 ("s s" . isearch-forward))
1344 :config (pdf-tools-install nil t)
1345 :custom (pdf-view-resize-factor 1.05))
1346
1347 (use-package org-pdftools
1348 :disabled
1349 :straight (:host github :repo "fuxialexander/org-pdftools")
1350 :demand
1351 :after org
1352 :config
1353 (with-eval-after-load 'org
1354 (require 'org-pdftools)))
1355
1356 (use-package biblio)
1357
1358 (use-package reftex
1359 :hook (latex-mode . reftex-mode))
1360
1361 (use-package reftex-cite
1362 :after reftex
1363 :disabled ; enable to disable
1364 ; reftex-cite's default choice
1365 ; of previous word
1366 :config
1367 (defun reftex-get-bibkey-default ()
1368 "If the cursor is in a citation macro, return the word before the macro."
1369 (let* ((macro (reftex-what-macro 1)))
1370 (save-excursion
1371 (when (and macro (string-match "cite" (car macro)))
1372 (goto-char (cdr macro)))
1373 (reftex-this-word)))))
1374
1375 (use-package minions
1376 :demand
1377 :config (minions-mode))
1378
1379 (use-package dmenu
1380 :custom
1381 (dmenu-prompt-string "run: ")
1382 (dmenu-save-file (b/var "dmenu-items")))
1383
1384 (use-package eosd
1385 ;; TODO: fix build by properly building the eosd-pixbuf.c module
1386 ;; e.g. see https://github.com/raxod502/straight.el/issues/386
1387 :disabled
1388 :straight (:host github :repo "clarete/eosd")
1389 :demand
1390 :after exwm
1391 :config
1392 (eosd-start))
1393
1394 (use-package eww
1395 :bind ("C-c a e w" . eww)
1396 :custom
1397 (eww-download-directory (file-name-as-directory
1398 (getenv "XDG_DOWNLOAD_DIR"))))
1399
1400 \f
1401 ;;; Post initialization
1402
1403 )
1404 (message "Loading %s...done (%.3fs)" user-init-file
1405 (float-time (time-subtract (current-time)
1406 b/before-user-init-time)))
1407
1408 ;;; init.el ends here