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