1 ;;; init.el --- bandali's emacs configuration -*- lexical-binding: t -*-
3 ;; Copyright (C) 2018-2019 Amin Bandali <bandali@gnu.org>
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.
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.
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/>.
20 ;; GNU Emacs configuration of Amin Bandali, computer scientist,
21 ;; Free Software activist, and GNU maintainer & webmaster. Packages
22 ;; are installed through GNU Guix for a fully reproducible setup.
23 ;; Before switching to Guix, I used straight.el, and before that Borg.
25 ;; Over the years, I've taken inspiration from configurations of many
26 ;; great people. Some that I can remember off the top of my head are:
28 ;; - https://github.com/dieggsy/dotfiles
29 ;; - https://github.com/dakra/dmacs
30 ;; - http://pages.sachachua.com/.emacs.d/Sacha.html
31 ;; - https://github.com/dakrone/eos
32 ;; - http://doc.rix.si/cce/cce.html
33 ;; - https://github.com/jwiegley/dot-emacs
34 ;; - https://github.com/wasamasa/dotemacs
35 ;; - https://github.com/hlissner/doom-emacs
39 ;;; Emacs initialization
41 (defvar b
/before-user-init-time
(current-time)
42 "Value of `current-time' when Emacs begins loading `user-init-file'.")
43 (defvar b
/emacs-initialized nil
44 "Whether Emacs has been initialized.")
45 (defvar b
/exwm-p
(string= (system-name) "chaman")
46 "Whether or not we will be using `exwm'.")
48 (when (not (bound-and-true-p b
/emacs-initialized
))
49 (message "Loading Emacs...done (%.3fs)"
50 (float-time (time-subtract b
/before-user-init-time
53 ;; temporarily increase `gc-cons-threshhold' and `gc-cons-percentage'
54 ;; during startup to reduce garbage collection frequency. clearing
55 ;; `file-name-handler-alist' seems to help reduce startup time too.
56 (defvar b
/gc-cons-threshold gc-cons-threshold
)
57 (defvar b
/gc-cons-percentage gc-cons-percentage
)
58 (defvar b
/file-name-handler-alist file-name-handler-alist
)
59 (setq gc-cons-threshold
(* 30 1024 1024) ; 30 MiB
60 gc-cons-percentage
0.6
61 file-name-handler-alist nil
62 ;; sidesteps a bug when profiling with esup
63 esup-child-profile-require-level
0)
65 ;; set them back to their defaults once we're done initializing
67 "My post-initialize function, run after loading `user-init-file'."
68 (setq b
/emacs-initialized t
69 gc-cons-threshold b
/gc-cons-threshold
70 gc-cons-percentage b
/gc-cons-percentage
71 file-name-handler-alist b
/file-name-handler-alist
)
73 (with-eval-after-load 'exwm-workspace
80 "[%s]" (number-to-string
81 exwm-workspace-current-index
)))))))))
82 (add-hook 'after-init-hook
#'b
/post-init
)
84 ;; increase number of lines kept in *Messages* log
85 (setq message-log-max
20000)
87 ;; optionally, uncomment to supress some byte-compiler warnings
88 ;; (see C-h v byte-compile-warnings RET for more info)
89 ;; (setq byte-compile-warnings
90 ;; '(not free-vars unresolved noruntime lexical make-local))
95 (setq user-full-name
"Amin Bandali"
96 user-mail-address
"bandali@gnu.org")
101 ;; useful for commenting out multiple sexps at a time
102 (defmacro comment
(&rest _
)
103 "Comment out one or more s-expressions."
104 (declare (indent defun
))
108 ;;; Package management
110 ;; No package.el (for emacs 26 and before)
111 (when (version< emacs-version
"27")
112 (setq package-enable-at-startup nil
)
113 ;; (package-initialize)
115 ;; for emacs 27 and later, we use early-init.el. see
116 ;; https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=24acb31c04b4048b85311d794e600ecd7ce60d3b
119 (add-to-list 'load-path
120 (expand-file-name "lib/borg" user-emacs-directory
))
123 (setq borg-rewrite-urls-alist
124 '(("git@github.com:" .
"https://github.com/")
125 ("git@gitlab.com:" .
"https://gitlab.com/"))))
128 (if nil
; set to t when need to debug init
130 (setq use-package-verbose t
131 use-package-expand-minimally nil
132 use-package-compute-statistics t
134 (require 'use-package
))
135 (setq use-package-verbose nil
136 use-package-expand-minimally t
))
138 (setq use-package-always-defer t
)
144 ;; keep ~/.emacs.d clean
145 (use-package no-littering
148 (defalias 'b
/etc
'no-littering-expand-etc-file-name
)
149 (defalias 'b
/var
'no-littering-expand-var-file-name
))
151 (use-package auto-compile
154 (auto-compile-on-load-mode)
155 (auto-compile-on-save-mode)
156 (setq auto-compile-display-buffer nil
)
157 (setq auto-compile-mode-line-counter t
)
158 (setq auto-compile-source-recreate-deletes-dest t
)
159 (setq auto-compile-toggle-deletes-nonlib-dest t
)
160 (setq auto-compile-update-autoloads t
))
162 ;; separate custom file (don't want it mixing with init.el)
166 (setq custom-file
(b/etc
"custom.el"))
167 (when (file-exists-p custom-file
)
169 ;; while at it, treat themes as safe
170 (setf custom-safe-themes t
)
171 ;; only one custom theme at a time
173 (defadvice load-theme
(before clear-previous-themes activate
)
174 "Clear existing theme settings instead of layering them"
175 (mapc #'disable-theme custom-enabled-themes
))))
177 ;; load the secrets file if it exists, otherwise show a warning
180 (load (b/etc
"secrets"))))
182 ;; start up emacs server. see
183 ;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html#Emacs-Server
186 :config
(or (server-running-p) (server-mode)))
195 (defmacro b
/setq-every
(value &rest vars
)
196 "Set all the variables from VARS to value VALUE."
197 (declare (indent defun
) (debug t
))
198 `(progn ,@(mapcar (lambda (x) (list 'setq x value
)) vars
)))
200 (defun b/start-process
(program &rest args
)
201 "Same as `start-process', but doesn't bother about name and buffer."
202 (let ((process-name (concat program
"_process"))
203 (buffer-name (generate-new-buffer-name
204 (concat program
"_output"))))
205 (apply #'start-process
206 process-name buffer-name program args
)))
208 (defun b/dired-start-process
(program &optional args
)
209 "Open current file with a PROGRAM."
210 ;; Shell command looks like this: "program [ARGS]... FILE" (ARGS can
211 ;; be nil, so remove it).
212 (apply #'b
/start-process
214 (remove nil
(list args
(dired-get-file-for-visit)))))
216 (defun b/add-elisp-section
()
220 (insert "\n\f\n;;; "))
222 ;; (defvar b/fill-column 47
223 ;; "My custom `fill-column'.")
225 (defconst b
/asterism
"* * *")
227 (defun b/insert-asterism
()
228 "Insert a centred asterism."
233 (make-string (floor (/ (- fill-column
(length b
/asterism
)) 2))
238 (defun b/no-mouse-autoselect-window
()
239 "Conveniently disable `focus-follows-mouse'.
240 For disabling the behaviour for certain buffers and/or modes."
241 (make-local-variable 'mouse-autoselect-window
)
242 (setq mouse-autoselect-window nil
))
244 (defun b/kill-current-buffer
()
245 "Kill the current buffer."
246 ;; also see https://redd.it/64xb3q
248 (kill-buffer (current-buffer)))
253 ;;;; C-level customizations
257 enable-recursive-minibuffers t
258 resize-mini-windows t
259 ;; more useful frame titles
260 frame-title-format
'("" invocation-name
" - "
262 (if (buffer-file-name)
263 (abbreviate-file-name (buffer-file-name))
265 ;; i don't feel like jumping out of my chair every now and again; so
266 ;; don't BEEP! at me, emacs
267 ring-bell-function
'ignore
270 ;; scroll-conservatively 10000
272 scroll-conservatively
10
273 scroll-preserve-screen-position
1
274 ;; focus follows mouse
275 mouse-autoselect-window t
)
278 ;; always use space for indentation
286 (dolist (ft (fontset-list))
290 (font-spec :name
"Source Code Pro" :size
14))
294 (font-spec :name
"DejaVu Sans Mono")
301 ;; :name "Symbola monospacified for DejaVu Sans Mono")
307 ;; (font-spec :name "DejaVu Sans Mono")
313 (font-spec :name
"DejaVu Sans Mono" :size
14)
317 ;;;; Elisp-level customizations
323 ;; don't need to see the startup echo area message
324 (advice-add #'display-startup-echo-area-message
:override
#'ignore
)
326 ;; i want *scratch* as my startup buffer
327 (initial-buffer-choice t
)
328 ;; i don't need the default hint
329 (initial-scratch-message nil
)
330 ;; use customizable text-mode as major mode for *scratch*
331 ;; (initial-major-mode 'text-mode)
332 ;; inhibit buffer list when more than 2 files are loaded
333 (inhibit-startup-buffer-menu t
)
334 ;; don't need to see the startup screen or echo area message
335 (inhibit-startup-screen t
)
336 (inhibit-startup-echo-area-message user-login-name
))
342 ;; backups (C-h v make-backup-files RET)
343 (backup-by-copying t
)
345 (delete-old-versions t
)
348 (auto-save-file-name-transforms
349 `((".*" ,(b/var
"auto-save/") t
)))
351 ;; insert newline at the end of files
352 (require-final-newline t
)
354 ;; open read-only file buffers in view-mode
355 ;; (enables niceties like `q' for quit)
358 ;; disable disabled commands
359 (setq disabled-command-function nil
)
361 ;; lazy-person-friendly yes/no prompts
362 (defalias 'yes-or-no-p
#'y-or-n-p
)
364 ;; enable automatic reloading of changed buffers and files
365 (use-package autorevert
368 (global-auto-revert-mode 1)
370 (auto-revert-verbose nil
)
371 (global-auto-revert-non-file-buffers nil
))
373 ;; time and battery in mode-line
379 (display-time-default-load-average nil
)
380 (display-time-format "%a %b %-e %-l:%M%P")
381 (display-time-mail-icon '(image :type xpm
:file
"gnus/gnus-pointer.xpm" :ascent center
))
382 (display-time-use-mail-icon t
))
387 (display-battery-mode)
389 (battery-mode-line-format " %p%% %t"))
395 ;; (fringe-mode '(3 . 1))
401 ;; enable winner-mode (C-h f winner-mode RET)
406 ;; don't display *compilation* buffer on success. based on
407 ;; https://stackoverflow.com/a/17788551, with changes to use `cl-letf'
408 ;; instead of the now obsolete `flet'.
409 (defun b/compilation-finish-function
(buffer outstr
)
410 (unless (string-match "finished" outstr
)
411 (switch-to-buffer-other-window buffer
))
414 (setq compilation-finish-functions
#'b
/compilation-finish-function
)
418 (defadvice compilation-start
419 (around inhibit-display
420 (command &optional mode name-function highlight-regexp
))
421 (if (not (string-match "^\\(find\\|grep\\)" command
))
422 (cl-letf (((symbol-function 'display-buffer
) #'ignore
))
423 (save-window-excursion ad-do-it
))
425 (ad-activate 'compilation-start
))
429 ;; allow scrolling in Isearch
430 (isearch-allow-scroll t
)
431 ;; search for non-ASCII characters: i’d like non-ASCII characters such
432 ;; as ‘’“”«»‹›áⓐ𝒶 to be selected when i search for their ASCII
433 ;; counterpart. shoutout to
434 ;; http://endlessparentheses.com/new-in-emacs-25-1-easily-search-non-ascii-characters.html
435 (search-default-mode #'char-fold-to-regexp
))
437 ;; uncomment to extend the above behaviour to query-replace
441 (replace-char-fold t
)))
444 :bind
("C-x v C-=" . vc-ediff
))
449 (vc-git-print-log-follow t
))
452 :config
(add-hook 'ediff-after-quit-hook-internal
'winner-undo
)
453 :custom
((ediff-window-setup-function 'ediff-setup-windows-plain
)
454 (ediff-split-window-function 'split-window-horizontally
)))
456 (use-package face-remap
458 ;; gentler font resizing
459 (text-scale-mode-step 1.05))
464 (setq mouse-wheel-scroll-amount
'(1 ((shift) .
1)) ; one line at a time
465 mouse-wheel-progressive-speed nil
; don't accelerate scrolling
466 mouse-wheel-follow-mouse t
)) ; scroll window under mouse
468 (use-package pixel-scroll
470 :config
(pixel-scroll-mode 1))
472 (use-package epg-config
474 ;; ask for GPG passphrase in minibuffer
475 ;; this will fail if gpg>=2.1 is not available
476 (if (version< "27" emacs-version
)
477 (setq epg-pinentry-mode
'loopback
)
478 (setq epa-pinentry-mode
'loopback
))
480 (epg-gpg-program (executable-find "gpg")))
485 (use-package pinentry
488 :after
(epa epg server
)
490 ;; workaround for systemd-based distros:
491 ;; (setq pinentry--socket-dir server-socket-dir)
494 (use-package auth-source
496 (auth-sources '("~/.authinfo.gpg"))
497 (authinfo-hidden (regexp-opt '("password" "client-secret" "token"))))
505 ("C-c e b" . eval-buffer
)
506 ("C-c e e" . eval-last-sexp
)
507 ("C-c e r" . eval-region
)
509 ("C-c e i" . emacs-init-time
)
510 ("C-c e u" . emacs-uptime
)
511 ("C-c e v" . emacs-version
)
513 ("C-c F m" . make-frame-command
)
514 ("C-c F d" . delete-frame
)
515 ("C-c F D" . server-edit
)
517 ("C-S-h C" . describe-char
)
518 ("C-S-h F" . describe-face
)
520 ("C-x k" . b
/kill-current-buffer
)
521 ("C-x K" . kill-buffer
)
522 ("C-x s" . save-buffer
)
523 ("C-x S" . save-some-buffers
)
525 :map emacs-lisp-mode-map
526 ("<C-return>" . b
/add-elisp-section
))
528 (when (display-graphic-p)
529 (unbind-key "C-z" global-map
))
532 ;; for back and forward mouse keys
533 ("<XF86Back>" . previous-buffer
)
534 ("<mouse-8>" . previous-buffer
)
535 ;; ("<drag-mouse-8>" . previous-buffer)
536 ("<XF86Forward>" . next-buffer
)
537 ("<mouse-9>" . next-buffer
)
538 ;; ("<drag-mouse-9>" . next-buffer)
539 ;; ("<drag-mouse-2>" . kill-this-buffer)
540 ;; ("<drag-mouse-3>" . switch-to-buffer)
544 ;;; Essential packages
547 (require 'bandali-exwm
))
551 (setq org-src-tab-acts-natively t
552 org-src-preserve-indentation nil
553 org-edit-src-content-indentation
0
554 org-link-email-description-format
"Email %c: %s" ; %.30s
555 org-highlight-latex-and-related
'(entities)
556 org-use-speed-commands t
557 org-startup-folded
'content
558 org-catch-invisible-edits
'show-and-error
560 (when (version< org-version
"9.3")
561 (setq org-email-link-description-format
562 org-link-email-description-format
))
563 (add-to-list 'org-structure-template-alist
'("L" .
"src emacs-lisp") t
)
564 (add-to-list 'org-modules
'org-habit
)
566 (("C-c a o a" . org-agenda
)
568 ("M-L" . org-insert-last-stored-link
)
569 ("M-O" . org-toggle-link-display
))
570 :hook
((org-mode . org-indent-mode
)
571 (org-mode . auto-fill-mode
)
572 (org-mode . flyspell-mode
))
574 (org-pretty-entities t
)
575 (org-agenda-files '("~/usr/org/todos/personal.org"
576 "~/usr/org/todos/habits.org"
577 "~/src/git/masters-thesis/todo.org"))
578 (org-agenda-start-on-weekday 0)
579 (org-agenda-time-leading-zero t
)
580 (org-habit-graph-column 44)
581 (org-latex-packages-alist '(("" "listings") ("" "color")))
583 '(org-block-begin-line ((t (:foreground
"#5a5b5a" :background
"#1d1f21"))))
584 '(org-block ((t (:background
"#1d1f21"))))
585 '(org-latex-and-related ((t (:foreground
"#b294bb")))))
587 (use-package ox-latex
590 (setq org-latex-listings
'listings
591 ;; org-latex-prefer-user-labels t
593 (add-to-list 'org-latex-classes
594 '("IEEEtran" "\\documentclass[11pt]{IEEEtran}"
595 ("\\section{%s}" .
"\\section*{%s}")
596 ("\\subsection{%s}" .
"\\subsection*{%s}")
597 ("\\subsubsection{%s}" .
"\\subsubsection*{%s}")
598 ("\\paragraph{%s}" .
"\\paragraph*{%s}")
599 ("\\subparagraph{%s}" .
"\\subparagraph*{%s}"))
601 (require 'ox-beamer
))
603 (use-package ox-extra
605 (ox-extras-activate '(latex-header-blocks ignore-headlines
)))
607 ;; asynchronous tangle, using emacs-async to asynchronously tangle an
608 ;; org file. closely inspired by
609 ;; https://github.com/dieggsy/dotfiles/tree/cc10edf7701958eff1cd94d4081da544d882a28c/emacs.d#dotfiles
610 (with-eval-after-load 'org
611 (defvar b
/show-async-tangle-results nil
612 "Keep *emacs* async buffers around for later inspection.")
614 (defvar b
/show-async-tangle-time nil
615 "Show the time spent tangling the file.")
617 (defun b/async-babel-tangle
()
618 "Tangle org file asynchronously."
620 (let* ((file-tangle-start-time (current-time))
621 (file (buffer-file-name))
622 (file-nodir (file-name-nondirectory file
))
623 ;; (async-quiet-switch "-q")
624 (file-noext (file-name-sans-extension file
)))
628 (org-babel-tangle-file ,file
))
629 (unless b
/show-async-tangle-results
632 (message "Tangled %s%s"
634 (if b
/show-async-tangle-time
636 (float-time (time-subtract (current-time)
637 ',file-tangle-start-time
)))
639 (message "Tangling %s failed" ,file-nodir
))))))))
642 'safe-local-variable-values
643 '(eval add-hook
'after-save-hook
#'b
/async-babel-tangle
'append
'local
))
645 ;; *the* right way to do git
648 :bind
(("C-x g" . magit-status
)
649 ("C-c g g" . magit-status
)
650 ("C-c g b" . magit-blame-addition
)
651 ("C-c g l" . magit-log-buffer-file
))
653 (magit-add-section-hook 'magit-status-sections-hook
654 'magit-insert-modules
655 'magit-insert-stashes
657 ;; (magit-add-section-hook 'magit-status-sections-hook
658 ;; 'magit-insert-ignored-files
659 ;; 'magit-insert-untracked-files
661 (setq magit-repository-directories
'(("~/.emacs.d/" .
0)
663 (nconc magit-section-initial-visibility-alist
664 '(([unpulled status
] . show
)
665 ([unpushed status
] . show
)))
667 (magit-diff-refine-hunk t
)
668 (magit-display-buffer-function #'magit-display-buffer-fullframe-status-v1
)
669 ;; (magit-completing-read-function 'magit-ido-completing-read)
670 :custom-face
(magit-diff-file-heading ((t (:weight normal
)))))
672 ;; recently opened files
676 ;; (add-to-list 'recentf-exclude "^/\\(?:ssh\\|su\\|sudo\\)?:")
680 (recentf-max-saved-items 2000))
682 ;; smart M-x enhancement (needed by counsel for history)
683 ;; (use-package smex)
686 ("C-c f ." . find-file
)
687 ("C-c f d" . find-name-dired
)
688 ("C-c f l" . find-library
)
689 ;; ("C-c f r" . recentf-open-files)
690 ("C-c x" . execute-extended-command
))
696 (:map ido-common-completion-map
697 ([escape] . minibuffer-keyboard-quit)
698 ("DEL" . b/ido-backspace))
701 (defun b/ido-backspace ()
702 "Forward to `backward-delete-char'. On error (read-only), quit."
705 (backward-delete-char 1)
707 (minibuffer-keyboard-quit))))
711 (ido-enable-flex-matching t)
712 ;; (ido-enable-regexp t)
713 ;; (ido-enable-prefix t)
714 (ido-max-window-height 10)
715 (ido-use-virtual-buffers t))
717 (use-package ido-vertical-mode
720 (ido-vertical-mode 1)
722 (ido-vertical-define-keys 'C-n-C-p-up-and-down)
723 (ido-vertical-show-count t))
725 (use-package ido-completing-read+
729 (ido-ubiquitous-mode 1))
731 (use-package crm-custom
736 (use-package icomplete
749 (:map ivy-minibuffer-map
750 ([escape] . keyboard-escape-quit
)
751 ([S-up
] . ivy-previous-history-element
)
752 ([S-down
] . ivy-next-history-element
)
753 ("DEL" . ivy-backward-delete-char
))
757 ivy-use-virtual-buffers t
758 ivy-virtual-abbreviate
'abbreviate
759 ivy-count-format
"%d/%d ")
761 (defvar b
/ivy-ignore-buffer-modes
'(magit-mode erc-mode dired-mode
))
762 (defun b/ivy-ignore-buffer-p
(str)
763 "Return non-nil if str names a buffer with a major mode
764 derived from one of `b/ivy-ignore-buffer-modes'.
766 This function is intended for use with `ivy-ignore-buffers'."
767 (let* ((buf (get-buffer str
))
768 (mode (and buf
(buffer-local-value 'major-mode buf
))))
770 (apply #'provided-mode-derived-p mode b
/ivy-ignore-buffer-modes
))))
771 (add-to-list 'ivy-ignore-buffers
'b
/ivy-ignore-buffer-p
)
775 (ivy-minibuffer-match-face-1 ((t (:background
"#eeeeee"))))
776 (ivy-minibuffer-match-face-2 ((t (:background
"#e7e7e7" :weight bold
))))
777 (ivy-minibuffer-match-face-3 ((t (:background
"light goldenrod" :weight semi-bold
))))
778 (ivy-minibuffer-match-face-4 ((t (:background
"misty rose" :weight semi-bold
))))
779 (ivy-current-match ((((class color
) (background light
))
780 :background
"#d7d7d7" :foreground
"black")
781 (((class color
) (background dark
))
782 :background
"#65a7e2" :foreground
"black"))))
787 :bind
(("C-S-s" . swiper-isearch
)))
792 :bind
(("C-c f r" . counsel-recentf
)
793 :map minibuffer-local-map
794 ("C-r" . counsel-minibuffer-history
))
797 (defalias 'locate
#'counsel-locate
))
803 :bind
("C-c a s e" . eshell
)
805 (eval-when-compile (defvar eshell-prompt-regexp
))
806 (defun b/eshell-quit-or-delete-char
(arg)
808 (if (and (eolp) (looking-back eshell-prompt-regexp nil
))
809 (eshell-life-is-too-much)
812 (defun b/eshell-clear
()
814 (let ((inhibit-read-only t
))
818 (defun b/eshell-setup
()
819 (make-local-variable 'company-idle-delay
)
820 (defvar company-idle-delay
)
821 (setq company-idle-delay nil
)
822 (bind-keys :map eshell-mode-map
823 ("C-d" . b
/eshell-quit-or-delete-char
)
824 ("C-S-l" . b
/eshell-clear
)
825 ("M-r" . counsel-esh-history
)
826 ;; ([tab] . company-complete)
828 (if (version< "27" emacs-version
)
829 (bind-keys :map eshell-hist-mode-map
830 ("M-r" . counsel-esh-history
))
831 (bind-keys :map eshell-mode-map
832 ("M-r" . counsel-esh-history
))))
835 eshell-prompt-regexp
"\\(.*\n\\)*[$#] "
836 eshell-prompt-function
839 (propertize (format "%s@%s:" (user-login-name) (system-name))
841 (propertize (abbreviate-file-name default-directory
)
842 'face
'font-lock-comment-face
)
843 (propertize "\n" 'face
'default
)
845 (propertize "#" 'face
'red
)
846 (propertize "$" 'face
'default
))
847 (propertize " " 'face
'default
))))
849 :hook
(eshell-mode . b
/eshell-setup
)
851 (eshell-hist-ignoredups t
)
852 (eshell-input-filter 'eshell-input-filter-initial-space
))
856 (("C-x C-b" . ibuffer
)
857 :map ibuffer-mode-map
858 ("P" . ibuffer-backward-filter-group
)
859 ("N" . ibuffer-forward-filter-group
)
860 ("M-p" . ibuffer-do-print
)
861 ("M-n" . ibuffer-do-shell-command-pipe-replace
))
863 ;; Use human readable Size column instead of original one
864 (define-ibuffer-column size-h
865 (:name
"Size" :inline t
)
867 ((> (buffer-size) 1000000) (format "%7.1fM" (/ (buffer-size) 1000000.0)))
868 ((> (buffer-size) 100000) (format "%7.0fk" (/ (buffer-size) 1000.0)))
869 ((> (buffer-size) 1000) (format "%7.1fk" (/ (buffer-size) 1000.0)))
870 (t (format "%8d" (buffer-size)))))
872 (ibuffer-saved-filter-groups
874 ("dired" (mode . dired-mode
))
875 ("org" (mode . org-mode
))
878 (mode . gnus-group-mode
)
879 (mode . gnus-summary-mode
)
880 (mode . gnus-article-mode
)
881 ;; not really, but...
882 (mode . message-mode
)))
901 (mode . emacs-lisp-mode
)
903 (mode . haskell-mode
)
906 (mode . alloy-mode
)))
910 (mode . latex-mode
)))
913 (name .
"^\\*scratch\\*$")
914 (name .
"^\\*Messages\\*$")))
915 ("exwm" (mode . exwm-mode
))
916 ("erc" (mode . erc-mode
)))))
918 '((mark modified read-only locked
" "
919 (name 72 72 :left
:elide
)
923 (mode 16 16 :left
:elide
)
924 " " filename-and-process
)
928 :hook
(ibuffer .
(lambda () (ibuffer-switch-to-saved-filter-groups "default"))))
932 :hook
(prog-mode . outline-minor-mode
)
935 outline-minor-mode-map
936 ("<s-tab>" . outline-toggle-children
)
937 ("M-p" . outline-previous-visible-heading
)
938 ("M-n" . outline-next-visible-heading
)
939 :prefix-map b
/outline-prefix-map
941 ("TAB" . outline-toggle-children
)
942 ("a" . outline-hide-body
)
943 ("H" . outline-hide-body
)
944 ("S" . outline-show-all
)
945 ("h" . outline-hide-subtree
)
946 ("s" . outline-show-subtree
)))
949 :custom
(ls-lisp-dirs-first t
))
953 (setq dired-dwim-target t
954 dired-listing-switches
"-alh"
955 ls-lisp-use-insert-directory-program nil
)
957 ;; easily diff 2 marked files
958 ;; https://oremacs.com/2017/03/18/dired-ediff/
959 (defun dired-ediff-files ()
962 (defvar ediff-after-quit-hook-internal
)
963 (let ((files (dired-get-marked-files))
964 (wnd (current-window-configuration)))
965 (if (<= (length files
) 2)
966 (let ((file1 (car files
))
967 (file2 (if (cdr files
)
971 (dired-dwim-target-directory)))))
972 (if (file-newer-than-file-p file1 file2
)
973 (ediff-files file2 file1
)
974 (ediff-files file1 file2
))
975 (add-hook 'ediff-after-quit-hook-internal
977 (setq ediff-after-quit-hook-internal nil
)
978 (set-window-configuration wnd
))))
979 (error "no more than 2 files should be marked"))))
982 (setq dired-guess-shell-alist-user
983 '(("\\.pdf\\'" "evince" "zathura" "okular")
984 ("\\.doc\\'" "libreoffice")
985 ("\\.docx\\'" "libreoffice")
986 ("\\.ppt\\'" "libreoffice")
987 ("\\.pptx\\'" "libreoffice")
988 ("\\.xls\\'" "libreoffice")
989 ("\\.xlsx\\'" "libreoffice")
990 ("\\.flac\\'" "mpv")))
991 :bind
(:map dired-mode-map
992 ("b" . dired-up-directory
)
993 ("E" . dired-ediff-files
)
994 ("e" . dired-toggle-read-only
)
995 ("\\" . dired-hide-details-mode
)
998 (b/dired-start-process
"zathura"))))
999 :hook
(dired-mode . dired-hide-details-mode
))
1003 (temp-buffer-resize-mode)
1004 (setq help-window-select t
))
1008 (add-to-list 'tramp-default-proxies-alist
'(nil "\\`root\\'" "/ssh:%h:"))
1009 (add-to-list 'tramp-default-proxies-alist
'("localhost" nil nil
))
1010 (add-to-list 'tramp-default-proxies-alist
1011 (list (regexp-quote (system-name)) nil nil
)))
1013 (use-package doc-view
1014 :bind
(:map doc-view-mode-map
1015 ("M-RET" . image-previous-line
)))
1020 ;; highlight uncommitted changes in the left fringe
1021 (use-package diff-hl
1024 (setq diff-hl-draw-borders nil
)
1025 (global-diff-hl-mode)
1026 :hook
(magit-post-refresh . diff-hl-magit-post-refresh
))
1028 ;; display Lisp objects at point in the echo area
1030 :when
(version< "25" emacs-version
)
1031 :config
(global-eldoc-mode))
1033 ;; highlight matching parens
1036 :config
(show-paren-mode))
1038 (use-package elec-pair
1040 :config
(electric-pair-mode))
1043 :config
(column-number-mode)
1045 ;; Save what I copy into clipboard from other applications into Emacs'
1046 ;; kill-ring, which would allow me to still be able to easily access
1047 ;; it in case I kill (cut or copy) something else inside Emacs before
1048 ;; yanking (pasting) what I'd originally intended to.
1049 (save-interprogram-paste-before-kill t
))
1051 ;; save minibuffer history
1052 (use-package savehist
1056 (add-to-list 'savehist-additional-variables
'kill-ring
))
1058 ;; automatically save place in files
1059 (use-package saveplace
1060 :when
(version< "25" emacs-version
)
1061 :config
(save-place-mode))
1063 (use-package prog-mode
1064 :config
(global-prettify-symbols-mode)
1065 (defun indicate-buffer-boundaries-left ()
1066 (setq indicate-buffer-boundaries
'left
))
1067 (add-hook 'prog-mode-hook
#'indicate-buffer-boundaries-left
))
1069 (use-package text-mode
1070 :bind
(:map text-mode-map
("C-*" . b
/insert-asterism
))
1071 :hook
((text-mode . indicate-buffer-boundaries-left
)
1072 (text-mode . flyspell-mode
)))
1074 (use-package conf-mode
1077 (use-package sh-mode
1080 (use-package company
1083 (:map company-active-map
1084 ([tab] . company-complete-common-or-cycle)
1085 ([escape] . company-abort)
1086 ("C-p" . company-select-previous-or-abort)
1087 ("C-n" . company-select-next-or-abort))
1089 (company-minimum-prefix-length 1)
1090 (company-selection-wrap-around t)
1091 (company-dabbrev-char-regexp "\\sw\\|\\s_\\|[-_]")
1092 (company-dabbrev-downcase nil)
1093 (company-dabbrev-ignore-case nil)
1095 ;; (global-company-mode t)
1098 (use-package flycheck
1100 :hook (prog-mode . flycheck-mode)
1102 (:map flycheck-mode-map
1103 ("M-P" . flycheck-previous-error)
1104 ("M-N" . flycheck-next-error))
1106 ;; Use the load-path from running Emacs when checking elisp files
1107 (setq flycheck-emacs-lisp-load-path 'inherit)
1109 ;; Only flycheck when I actually save the buffer
1110 (setq flycheck-check-syntax-automatically '(mode-enabled save))
1111 :custom (flycheck-mode-line-prefix "flyc"))
1113 (use-package flyspell)
1115 ;; http://endlessparentheses.com/ispell-and-apostrophes.html
1119 ;; ’ can be part of a word
1120 (setq ispell-local-dictionary-alist
1121 `((nil "[[:alpha:]]" "[^[:alpha:]]"
1122 "['\x2019]" nil ("-B") nil utf-8))
1123 ispell-program-name (executable-find "hunspell"))
1124 ;; don't send ’ to the subprocess
1125 (defun endless/replace-apostrophe (args)
1126 (cons (replace-regexp-in-string
1129 (advice-add #'ispell-send-string :filter-args
1130 #'endless/replace-apostrophe)
1132 ;; convert ' back to ’ from the subprocess
1133 (defun endless/replace-quote (args)
1134 (if (not (derived-mode-p 'org-mode))
1136 (cons (replace-regexp-in-string
1139 (advice-add #'ispell-parse-output :filter-args
1140 #'endless/replace-quote))
1143 :hook (text-mode . abbrev-mode))
1146 ;;; Programming modes
1148 (use-package lisp-mode
1150 (defun indent-spaces-mode ()
1151 (setq indent-tabs-mode nil))
1152 (add-hook 'lisp-interaction-mode-hook #'indent-spaces-mode))
1155 :hook (emacs-lisp-mode . reveal-mode))
1157 (use-package elisp-mode)
1159 ;; (use-package alloy-mode
1160 ;; :straight (:host github :repo "dwwmmn/alloy-mode")
1161 ;; :mode "\\.\\(als\\|dsh\\)\\'"
1163 ;; (setq alloy-basic-offset 2)
1164 ;; ;; (defun b/alloy-simple-indent (start end)
1165 ;; ;; (interactive "r")
1166 ;; ;; ;; (if (region-active-p)
1167 ;; ;; ;; (indent-rigidly start end alloy-basic-offset)
1169 ;; ;; ;; (indent-rigidly (line-beginning-position)
1170 ;; ;; ;; (line-end-position)
1171 ;; ;; ;; alloy-basic-offset)))
1172 ;; ;; (indent-to (+ (current-column) alloy-basic-offset)))
1173 ;; :bind (:map alloy-mode-map
1174 ;; ("RET" . electric-newline-and-maybe-indent)
1175 ;; ;; ("TAB" . b/alloy-simple-indent)
1176 ;; ("TAB" . indent-for-tab-command))
1177 ;; :hook (alloy-mode . (lambda () (setq-local indent-tabs-mode nil))))
1179 (eval-when-compile (defvar lean-mode-map))
1180 (use-package lean-mode
1182 :bind (:map lean-mode-map
1183 ("S-SPC" . company-complete))
1185 (require 'lean-input)
1186 (setq default-input-method "Lean"
1187 lean-input-tweak-all '(lean-input-compose
1188 (lean-input-prepend "/")
1189 (lean-input-nonempty))
1190 lean-input-user-translations '(("/" "/")))
1193 (use-package mhtml-mode)
1195 (use-package sgml-mode
1197 (setq sgml-basic-offset 0))
1199 (use-package css-mode
1201 (setq css-indent-offset 2))
1203 (use-package emmet-mode
1204 :after (:any mhtml-mode css-mode sgml-mode)
1205 :bind* (("C-)" . emmet-next-edit-point)
1206 ("C-(" . emmet-prev-edit-point))
1208 (unbind-key "C-j" emmet-mode-keymap)
1209 (setq emmet-move-cursor-between-quotes t)
1210 :hook (css-mode html-mode sgml-mode))
1212 (use-package geiser)
1214 (use-package geiser-guile
1216 (setq geiser-guile-load-path "~/src/git/guix"))
1223 (font-latex-fontify-sectioning 'color)))
1225 (use-package go-mode
1228 (use-package po-mode
1230 (po-mode . (lambda () (run-with-timer 0.1 nil 'View-exit))))
1232 (use-package tex-mode
1235 (lambda (p) (string-match "^---?" (car p)))
1236 tex--prettify-symbols-alist)
1237 :hook ((tex-mode . auto-fill-mode)
1238 (tex-mode . flyspell-mode)))
1240 ;; (use-package george-mode
1241 ;; :straight (:host nil :repo "https://git.shemshak.org/amin/george-mode")
1242 ;; :mode "\\.grg\\'")
1247 (add-to-list 'custom-theme-load-path
1249 (convert-standard-filename "lisp") user-emacs-directory))
1250 (load-theme 'tangomod t)
1252 (use-package smart-mode-line
1253 :commands (sml/apply-theme)
1256 ;; thanks, but no thnaks; don't make fixed-width fills.
1257 (defun sml/fill-for-buffer-identification () "")
1258 (setq sml/theme 'tangomod)
1260 (smart-mode-line-enable))
1262 (use-package doom-modeline
1265 :hook (after-init . doom-modeline-init)
1267 (doom-modeline-buffer-file-name-style 'relative-to-project))
1269 (use-package doom-themes)
1275 (setq x-underline-at-descent-line t)
1276 (let ((line (face-attribute 'mode-line :underline)))
1277 (set-face-attribute 'mode-line nil :overline line)
1278 (set-face-attribute 'mode-line-inactive nil :overline line)
1279 (set-face-attribute 'mode-line-inactive nil :underline line)
1280 (set-face-attribute 'mode-line nil :box nil)
1281 (set-face-attribute 'mode-line-inactive nil :box nil)
1282 (set-face-attribute 'mode-line-inactive nil :background "#e1e1e1")) ; d3d7cf
1283 (moody-replace-mode-line-buffer-identification)
1284 (moody-replace-vc-mode))
1286 (use-package mini-modeline
1289 :config (mini-modeline-mode))
1291 (defvar b/org-mode-font-lock-keywords
1292 '(("[ \t]*\\(#\\+\\(BEGIN\\|END\\|begin\\|end\\)_\\(\\S-+\\)\\)[ \t]*\\([^\n:]*\\)"
1293 (1 '(:foreground "#5a5b5a" :background "#292b2b") t) ; directive
1294 (3 '(:foreground "#81a2be" :background "#292b2b") t) ; kind
1295 (4 '(:foreground "#c5c8c6") t))) ; title
1296 "For use with the `doom-tomorrow-night' theme.")
1298 (defun b/lights-on ()
1299 "Enable my favourite light theme."
1301 (mapc #'disable-theme custom-enabled-themes)
1302 (load-theme 'tangomod t)
1303 (when (featurep 'smart-mode-line)
1304 (sml/apply-theme 'tangomod))
1305 (font-lock-remove-keywords
1306 'org-mode b/org-mode-font-lock-keywords)
1307 (when (featurep 'erc-hl-nicks)
1308 (erc-hl-nicks-reset-face-table))
1309 (when (featurep 'exwm-systemtray)
1310 (exwm-systemtray--refresh)))
1312 (defun b/lights-off ()
1315 (mapc #'disable-theme custom-enabled-themes)
1316 (load-theme 'doom-one t)
1317 (when (featurep 'smart-mode-line)
1318 (sml/apply-theme 'automatic))
1319 (font-lock-add-keywords
1320 'org-mode b/org-mode-font-lock-keywords t)
1321 (when (featurep 'erc-hl-nicks)
1322 (erc-hl-nicks-reset-face-table))
1323 (when (featurep 'exwm-systemtray)
1324 (exwm-systemtray--refresh)))
1327 ("C-c t d" . b/lights-off)
1328 ("C-c t l" . b/lights-on))
1331 ;;; Emacs enhancements & auxiliary packages
1334 :config (setq Man-width 80))
1336 (use-package which-key
1339 (which-key-add-key-based-replacements
1340 ;; prefixes for global prefixes and minor modes
1343 "C-x RET" "coding system"
1345 "C-x @" "event modifiers"
1346 "C-x a" "abbrev/expand"
1347 "C-x r" "rectangle/register/bookmark"
1349 "C-x v" "version control"
1353 ;; prefixes for my personal bindings
1355 "C-c a" "applications"
1360 "C-c c" "compile-and-comments"
1366 "C-c m" "multiple-cursors"
1367 "C-c p" "projectile"
1368 "C-c p s" "projectile/search"
1369 "C-c p x" "projectile/execute"
1370 "C-c p 4" "projectile/other-window"
1376 ;; prefixes for major modes
1377 (which-key-add-major-mode-key-based-replacements 'message-mode
1378 "C-c f n" "footnote")
1379 (which-key-add-major-mode-key-based-replacements 'org-mode
1380 "C-c C-v" "org-babel")
1384 (which-key-add-column-padding 5)
1385 (which-key-max-description-length 32))
1387 (use-package crux ; results in Waiting for git... [2 times]
1389 :bind (("C-c d" . crux-duplicate-current-line-or-region)
1390 ("C-c M-d" . crux-duplicate-and-comment-current-line-or-region)
1391 ("C-c f C" . crux-copy-file-preserve-attributes)
1392 ("C-c f D" . crux-delete-file-and-buffer)
1393 ("C-c f R" . crux-rename-file-and-buffer)
1394 ("C-c j" . crux-top-join-line)
1395 ("C-S-j" . crux-top-join-line)))
1398 :bind (("C-a" . mwim-beginning-of-code-or-line)
1399 ("C-e" . mwim-end-of-code-or-line)
1400 ("<home>" . mwim-beginning-of-line-or-code)
1401 ("<end>" . mwim-end-of-line-or-code)))
1403 (use-package projectile
1406 :bind-keymap ("C-c p" . projectile-command-map)
1410 (defun b/projectile-mode-line-fun ()
1411 "Report project name and type in the modeline."
1412 (let ((project-name (projectile-project-name))
1413 (project-type (projectile-project-type)))
1415 projectile-mode-line-prefix
1417 (format ":%s" project-type)
1419 (setq projectile-mode-line-function 'b/projectile-mode-line-fun)
1421 (defun my-projectile-invalidate-cache (&rest _args)
1422 ;; ignore the args to `magit-checkout'
1423 (projectile-invalidate-cache nil))
1425 (eval-after-load 'magit-branch
1427 (advice-add 'magit-checkout
1428 :after #'my-projectile-invalidate-cache)
1429 (advice-add 'magit-branch-and-checkout
1430 :after #'my-projectile-invalidate-cache)))
1432 (projectile-completion-system 'ivy)
1433 (projectile-mode-line-prefix " proj"))
1435 (use-package helpful
1438 (("C-S-h c" . helpful-command)
1439 ("C-S-h f" . helpful-callable) ; helpful-function
1440 ("C-S-h v" . helpful-variable)
1441 ("C-S-h k" . helpful-key)
1442 ("C-S-h p" . helpful-at-point)))
1444 (use-package unkillable-scratch
1447 (unkillable-scratch 1)
1449 (unkillable-buffers '("^\\*scratch\\*$" "^\\*Messages\\*$")))
1452 ;; | make pretty boxed quotes like this
1454 (use-package boxquote
1457 (:prefix-map b/boxquote-prefix-map
1459 ("b" . boxquote-buffer)
1460 ("B" . boxquote-insert-buffer)
1461 ("d" . boxquote-defun)
1462 ("F" . boxquote-insert-file)
1463 ("hf" . boxquote-describe-function)
1464 ("hk" . boxquote-describe-key)
1465 ("hv" . boxquote-describe-variable)
1466 ("hw" . boxquote-where-is)
1467 ("k" . boxquote-kill)
1468 ("p" . boxquote-paragraph)
1469 ("q" . boxquote-boxquote)
1470 ("r" . boxquote-region)
1471 ("s" . boxquote-shell-command)
1472 ("t" . boxquote-text)
1473 ("T" . boxquote-title)
1474 ("u" . boxquote-unbox)
1475 ("U" . boxquote-unbox-region)
1476 ("y" . boxquote-yank)
1477 ("M-q" . boxquote-fill-paragraph)
1478 ("M-w" . boxquote-kill-ring-save)))
1480 (use-package orgalist
1481 ;; breaks auto-fill-mode, showing this error:
1482 ;; orgalist--boundaries: Lisp nesting exceeds ‘max-lisp-eval-depth’
1485 :hook (message-mode . orgalist-mode))
1487 ;; highlight TODOs in buffers
1488 (use-package hl-todo
1491 (global-hl-todo-mode))
1493 (use-package multi-term
1496 :bind (("C-c a s m m" . multi-term)
1497 ("C-c a s m d" . multi-term-dedicated-toggle)
1498 ("C-c a s m p" . multi-term-prev)
1499 ("C-c a s m n" . multi-term-next)
1501 ("C-c C-j" . term-char-mode))
1503 (setq multi-term-program "screen"
1504 multi-term-program-switches (concat "-c"
1505 (getenv "XDG_CONFIG_HOME")
1507 ;; TODO: add separate bindings for connecting to existing
1508 ;; session vs. always creating a new one
1509 multi-term-dedicated-select-after-open-p t
1510 multi-term-dedicated-window-height 20
1511 multi-term-dedicated-max-window-height 30
1513 '(("C-c C-c" . term-interrupt-subjob)
1514 ("C-c C-e" . term-send-esc)
1515 ("C-c C-j" . term-line-mode)
1517 ;; ("C-y" . term-paste)
1518 ("C-y" . term-send-raw)
1519 ("M-f" . term-send-forward-word)
1520 ("M-b" . term-send-backward-word)
1521 ("M-p" . term-send-up)
1522 ("M-n" . term-send-down)
1523 ("M-j" . term-send-raw-meta)
1524 ("M-y" . term-send-raw-meta)
1525 ("M-/" . term-send-raw-meta)
1526 ("M-0" . term-send-raw-meta)
1527 ("M-1" . term-send-raw-meta)
1528 ("M-2" . term-send-raw-meta)
1529 ("M-3" . term-send-raw-meta)
1530 ("M-4" . term-send-raw-meta)
1531 ("M-5" . term-send-raw-meta)
1532 ("M-6" . term-send-raw-meta)
1533 ("M-7" . term-send-raw-meta)
1534 ("M-8" . term-send-raw-meta)
1535 ("M-9" . term-send-raw-meta)
1536 ("<C-backspace>" . term-send-backward-kill-word)
1537 ("<M-DEL>" . term-send-backward-kill-word)
1538 ("M-d" . term-send-delete-word)
1539 ("M-," . term-send-raw)
1540 ("M-." . comint-dynamic-complete))
1541 term-unbind-key-alist
1542 '("C-z" "C-x" "C-c" "C-h"
1546 (use-package page-break-lines
1549 (page-break-lines-max-width fill-column)
1551 (global-page-break-lines-mode))
1553 (use-package expand-region
1554 :bind ("C-=" . er/expand-region))
1556 (use-package multiple-cursors
1558 (("C-S-<mouse-1>" . mc/add-cursor-on-click)
1559 (:prefix-map b/mc-prefix-map
1561 ("c" . mc/edit-lines)
1562 ("n" . mc/mark-next-like-this)
1563 ("p" . mc/mark-previous-like-this)
1564 ("a" . mc/mark-all-like-this))))
1566 (use-package yasnippet
1569 (defconst yas-verbosity-cur yas-verbosity)
1570 (setq yas-verbosity 2)
1571 (add-to-list 'yas-snippet-dirs "~/src/git/guix/etc/snippets" t)
1573 (setq yas-verbosity yas-verbosity-cur)
1575 (defun b/yas--maybe-expand-key-filter (cmd)
1576 (when (and (yas--maybe-expand-key-filter cmd)
1577 (not (bound-and-true-p git-commit-mode)))
1579 (defconst b/yas-maybe-expand
1580 '(menu-item "" yas-expand :filter b/yas--maybe-expand-key-filter))
1581 (define-key yas-minor-mode-map
1582 (kbd "SPC") b/yas-maybe-expand)
1586 (use-package debbugs
1588 (("C-c D d" . debbugs-gnu)
1589 ("C-c D b" . debbugs-gnu-bugs)
1592 (interactive) ; bug-gnu-emacs
1593 (setq debbugs-gnu-current-suppress t)
1594 (debbugs-gnu debbugs-gnu-default-severities '("emacs"))))
1595 ("C-c D g" . ; bug-gnuzilla
1598 (setq debbugs-gnu-current-suppress t)
1599 (debbugs-gnu debbugs-gnu-default-severities '("gnuzilla"))))
1600 ("C-c D G b" . ; bug-guix
1603 (setq debbugs-gnu-current-suppress t)
1604 (debbugs-gnu debbugs-gnu-default-severities '("guix"))))
1605 ("C-c D G p" . ; guix-patches
1608 (setq debbugs-gnu-current-suppress t)
1609 (debbugs-gnu debbugs-gnu-default-severities '("guix-patches"))))))
1611 (use-package org-ref
1613 (b/setq-every '("~/usr/org/references.bib")
1614 reftex-default-bibliography
1615 org-ref-default-bibliography)
1617 org-ref-bibliography-notes "~/usr/org/notes.org"
1618 org-ref-pdf-directory "~/usr/org/bibtex-pdfs/"))
1620 ;; (use-package fill-column-indicator)
1624 (("C-c w e" . (lambda ()
1626 (split-window-right)
1628 (erc-switch-to-buffer)))
1629 ("C-c w s l" . (lambda ()
1631 (split-window-right)
1633 ("C-c w s j" . (lambda ()
1635 (split-window-below)
1637 ("C-c w q" . quit-window))
1639 (split-width-threshold 150))
1641 (use-package windmove
1644 (("C-c w h" . windmove-left)
1645 ("C-c w j" . windmove-down)
1646 ("C-c w k" . windmove-up)
1647 ("C-c w l" . windmove-right)
1648 ("C-c w H" . windmove-swap-states-left)
1649 ("C-c w J" . windmove-swap-states-down)
1650 ("C-c w K" . windmove-swap-states-up)
1651 ("C-c w L" . windmove-swap-states-right)))
1655 :bind ("C-c a p" . pass)
1656 :hook (pass-mode . View-exit))
1658 (use-package pdf-tools
1660 :bind (:map pdf-view-mode-map
1661 ("<C-XF86Back>" . pdf-history-backward)
1662 ("<mouse-8>" . pdf-history-backward)
1663 ("<drag-mouse-8>" . pdf-history-backward)
1664 ("<C-XF86Forward>" . pdf-history-forward)
1665 ("<mouse-9>" . pdf-history-forward)
1666 ("<drag-mouse-9>" . pdf-history-forward)
1667 ("M-RET" . image-previous-line)
1668 ("C-s" . isearch-forward)
1669 ("s s" . isearch-forward))
1670 :config (pdf-tools-install nil t)
1671 :custom (pdf-view-resize-factor 1.05))
1673 (use-package org-pdftools
1675 :straight (:host github :repo "fuxialexander/org-pdftools")
1679 (with-eval-after-load 'org
1680 (require 'org-pdftools)))
1682 (use-package biblio)
1685 :hook (latex-mode . reftex-mode))
1687 (use-package reftex-cite
1689 :disabled ; enable to disable
1690 ; reftex-cite's default choice
1693 (defun reftex-get-bibkey-default ()
1694 "If the cursor is in a citation macro, return the word before the macro."
1695 (let* ((macro (reftex-what-macro 1)))
1697 (when (and macro (string-match "cite" (car macro)))
1698 (goto-char (cdr macro)))
1699 (reftex-this-word)))))
1701 (use-package minions
1703 :config (minions-mode))
1707 (dmenu-prompt-string "run: ")
1708 (dmenu-save-file (b/var "dmenu-items")))
1711 ;; TODO: fix build by properly building the eosd-pixbuf.c module
1712 ;; e.g. see https://github.com/raxod502/straight.el/issues/386
1714 :straight (:host github :repo "clarete/eosd")
1720 (use-package scpaste
1723 (setq scpaste-http-destination "https://p.bndl.org"
1724 scpaste-scp-destination "nix:/var/www/p.bndl.org"))
1727 :bind ("C-c a e w" . eww)
1729 (eww-download-directory (file-name-as-directory
1730 (getenv "XDG_DOWNLOAD_DIR"))))
1733 ;;; Email (with Gnus)
1735 (defvar b/maildir (expand-file-name "~/mail/"))
1736 (with-eval-after-load 'recentf
1737 (add-to-list 'recentf-exclude b/maildir))
1740 b/gnus-init-file (b/etc "gnus")
1741 mail-user-agent 'gnus-user-agent
1742 read-mail-command 'gnus)
1745 :bind (("s-m" . gnus-plugged)
1746 ("s-M" . gnus-unplugged)
1747 ("C-c a m" . gnus-plugged)
1748 ("C-c a M" . gnus-unplugged))
1751 gnus-select-method '(nnnil "")
1752 gnus-secondary-select-methods
1753 '((nnimap "shemshak"
1754 (nnimap-stream plain)
1755 (nnimap-address "127.0.0.1")
1756 (nnimap-server-port 143)
1757 (nnimap-authenticator plain)
1758 (nnimap-user "amin@shemshak.local"))
1760 (nnimap-stream plain)
1761 (nnimap-address "127.0.0.1")
1762 (nnimap-server-port 143)
1763 (nnimap-authenticator plain)
1764 (nnimap-user "bandali@gnu.local")
1765 (nnimap-inbox "INBOX")
1766 (nnimap-split-methods 'nnimap-split-fancy)
1767 (nnimap-split-fancy (|
1768 ;; (: gnus-registry-split-fancy-with-parent)
1769 ;; (: gnus-group-split-fancy "INBOX" t "INBOX")
1771 (list ".*<\\(.*\\)\\.\\(non\\)?gnu\\.org>.*" "l.\\1")
1773 (list ".*<\\(.*\\)\\.gnus\\.org>.*" "l.\\1")
1775 (list ".*<\\(.*\\)\\.libreplanet\\.org>.*" "l.\\1")
1776 ;; *.lists.sr.ht, omitting one dot if present
1777 ;; add more \\.?\\([^.]*\\) if needed
1778 (list ".*<~\\(.*\\)/\\([^.]*\\)\\.?\\([^.]*\\)\\.lists.sr.ht>.*" "l.~\\1.\\2\\3")
1780 (from "webmasters\\(-comment\\)?@gnu\\.org" "webmasters")
1782 (list ".*atreus.freelists.org" "l.atreus")
1783 (list ".*deepspec.lists.cs.princeton.edu" "l.deepspec")
1784 ;; (list ".*haskell-art.we.lurk.org" "l.haskell.art") ;d
1785 (list ".*haskell-cafe.haskell.org" "l.haskell-cafe")
1786 ;; (list ".*notmuch.notmuchmail.org" "l.notmuch") ;u
1787 ;; (list ".*dev.lists.parabola.nu" "l.parabola-dev") ;u
1788 ;; ----------------------------------
1789 ;; legend: (u)nsubscribed | (d)ead
1790 ;; ----------------------------------
1791 ;; otherwise, leave mail in INBOX
1794 (nnimap-stream plain)
1795 (nnimap-address "127.0.0.1")
1796 (nnimap-server-port 143)
1797 (nnimap-authenticator plain)
1798 (nnimap-user "abandali@uw.local")
1799 (nnimap-inbox "INBOX")
1800 (nnimap-split-methods 'nnimap-split-fancy)
1801 (nnimap-split-fancy (|
1802 ;; (: gnus-registry-split-fancy-with-parent)
1804 ("subject" "SE\\s-?212" "course.se212-f19")
1805 (from "SE\\s-?212" "course.se212-f19")
1809 (nnimap-stream plain)
1810 (nnimap-address "127.0.0.1")
1811 (nnimap-server-port 143)
1812 (nnimap-authenticator plain)
1813 (nnimap-user "abandali@csc.uw.local")))
1814 gnus-message-archive-group "nnimap+gnu:INBOX"
1817 (to-address . "atreus@freelists.org")
1818 (to-list . "atreus@freelists.org"))
1820 (to-address . "deepspec@lists.cs.princeton.edu")
1821 (to-list . "deepspec@lists.cs.princeton.edu")
1822 (list-identifier . "\\[deepspec\\]"))
1824 (to-address . "emacs-devel@gnu.org")
1825 (to-list . "emacs-devel@gnu.org"))
1826 ("l\\.help-gnu-emacs"
1827 (to-address . "help-gnu-emacs@gnu.org")
1828 (to-list . "help-gnu-emacs@gnu.org"))
1829 ("l\\.info-gnu-emacs"
1830 (to-address . "info-gnu-emacs@gnu.org")
1831 (to-list . "info-gnu-emacs@gnu.org"))
1832 ("l\\.emacs-orgmode"
1833 (to-address . "emacs-orgmode@gnu.org")
1834 (to-list . "emacs-orgmode@gnu.org")
1835 (list-identifier . "\\[O\\]"))
1836 ("l\\.emacs-tangents"
1837 (to-address . "emacs-tangents@gnu.org")
1838 (to-list . "emacs-tangents@gnu.org"))
1839 ("l\\.emacsconf-committee"
1840 (to-address . "emacsconf-committee@gnu.org")
1841 (to-list . "emacsconf-committee@gnu.org"))
1842 ("l\\.emacsconf-discuss"
1843 (to-address . "emacsconf-discuss@gnu.org")
1844 (to-list . "emacsconf-discuss@gnu.org"))
1845 ("l\\.emacsconf-register"
1846 (to-address . "emacsconf-register@gnu.org")
1847 (to-list . "emacsconf-register@gnu.org"))
1848 ("l\\.emacsconf-submit"
1849 (to-address . "emacsconf-submit@gnu.org")
1850 (to-list . "emacsconf-submit@gnu.org"))
1851 ("l\\.fencepost-users"
1852 (to-address . "fencepost-users@gnu.org")
1853 (to-list . "fencepost-users@gnu.org")
1854 (list-identifier . "\\[Fencepost-users\\]"))
1855 ("l\\.gnewsense-art"
1856 (to-address . "gnewsense-art@nongnu.org")
1857 (to-list . "gnewsense-art@nongnu.org")
1858 (list-identifier . "\\[gNewSense-art\\]"))
1859 ("l\\.gnewsense-dev"
1860 (to-address . "gnewsense-dev@nongnu.org")
1861 (to-list . "gnewsense-dev@nongnu.org")
1862 (list-identifier . "\\[Gnewsense-dev\\]"))
1863 ("l\\.gnewsense-users"
1864 (to-address . "gnewsense-users@nongnu.org")
1865 (to-list . "gnewsense-users@nongnu.org")
1866 (list-identifier . "\\[gNewSense-users\\]"))
1867 ("l\\.gnunet-developers"
1868 (to-address . "gnunet-developers@gnu.org")
1869 (to-list . "gnunet-developers@gnu.org")
1870 (list-identifier . "\\[GNUnet-developers\\]"))
1872 (to-address . "help-gnunet@gnu.org")
1873 (to-list . "help-gnunet@gnu.org")
1874 (list-identifier . "\\[Help-gnunet\\]"))
1876 (to-address . "bug-gnuzilla@gnu.org")
1877 (to-list . "bug-gnuzilla@gnu.org")
1878 (list-identifier . "\\[Bug-gnuzilla\\]"))
1880 (to-address . "gnuzilla-dev@gnu.org")
1881 (to-list . "gnuzilla-dev@gnu.org")
1882 (list-identifier . "\\[Gnuzilla-dev\\]"))
1884 (to-address . "guile-devel@gnu.org")
1885 (to-list . "guile-devel@gnu.org"))
1887 (to-address . "guile-user@gnu.org")
1888 (to-list . "guile-user@gnu.org"))
1890 (to-address . "guix-devel@gnu.org")
1891 (to-list . "guix-devel@gnu.org"))
1893 (to-address . "help-guix@gnu.org")
1894 (to-list . "help-guix@gnu.org"))
1896 (to-address . "info-guix@gnu.org")
1897 (to-list . "info-guix@gnu.org"))
1898 ("l\\.savannah-hackers-public"
1899 (to-address . "savannah-hackers-public@gnu.org")
1900 (to-list . "savannah-hackers-public@gnu.org"))
1901 ("l\\.savannah-users"
1902 (to-address . "savannah-users@gnu.org")
1903 (to-list . "savannah-users@gnu.org"))
1905 (to-address . "www-commits@gnu.org")
1906 (to-list . "www-commits@gnu.org"))
1908 (to-address . "www-discuss@gnu.org")
1909 (to-list . "www-discuss@gnu.org"))
1911 (to-address . "haskell-art@we.lurk.org")
1912 (to-list . "haskell-art@we.lurk.org")
1913 (list-identifier . "\\[haskell-art\\]"))
1915 (to-address . "haskell-cafe@haskell.org")
1916 (to-list . "haskell-cafe@haskell.org")
1917 (list-identifier . "\\[Haskell-cafe\\]"))
1919 (to-address . "notmuch@notmuchmail.org")
1920 (to-list . "notmuch@notmuchmail.org"))
1922 (to-address . "dev@lists.parabola.nu")
1923 (to-list . "dev@lists.parabola.nu")
1924 (list-identifier . "\\[Dev\\]"))
1925 ("l\\.~bandali\\.public-inbox"
1926 (to-address . "~bandali/public-inbox@lists.sr.ht")
1927 (to-list . "~bandali/public-inbox@lists.sr.ht"))
1928 ("l\\.~sircmpwn\\.free-writers-club"
1929 (to-address . "~sircmpwn/free-writers-club@lists.sr.ht")
1930 (to-list . "~sircmpwn/free-writers-club@lists.sr.ht"))
1931 ("l\\.~sircmpwn\\.srht-admins"
1932 (to-address . "~sircmpwn/sr.ht-admins@lists.sr.ht")
1933 (to-list . "~sircmpwn/sr.ht-admins@lists.sr.ht"))
1934 ("l\\.~sircmpwn\\.srht-announce"
1935 (to-address . "~sircmpwn/sr.ht-announce@lists.sr.ht")
1936 (to-list . "~sircmpwn/sr.ht-announce@lists.sr.ht"))
1937 ("l\\.~sircmpwn\\.srht-dev"
1938 (to-address . "~sircmpwn/sr.ht-dev@lists.sr.ht")
1939 (to-list . "~sircmpwn/sr.ht-dev@lists.sr.ht"))
1940 ("l\\.~sircmpwn\\.srht-discuss"
1941 (to-address . "~sircmpwn/sr.ht-discuss@lists.sr.ht")
1942 (to-list . "~sircmpwn/sr.ht-discuss@lists.sr.ht"))
1944 (to-address . "webmasters@gnu.org")
1945 (to-list . "webmasters@gnu.org"))
1952 gnus-large-newsgroup 50
1953 gnus-home-directory (b/var "gnus/")
1954 gnus-directory (concat gnus-home-directory "news/")
1955 message-directory (concat gnus-home-directory "mail/")
1956 nndraft-directory (concat gnus-home-directory "drafts/")
1957 gnus-save-newsrc-file nil
1958 gnus-read-newsrc-file nil
1959 gnus-interactive-exit nil
1960 gnus-gcc-mark-as-read t)
1962 (when (version< emacs-version "27")
1963 (with-eval-after-load 'nnmail
1965 'nnmail-split-abbrev-alist
1966 '(list . "list-id\\|list-post\\|x-mailing-list\\|x-beenthere\\|x-loop")
1969 ;; (gnus-registry-initialize)
1971 (with-eval-after-load 'recentf
1972 (add-to-list 'recentf-exclude gnus-home-directory)))
1974 (use-package gnus-art
1977 gnus-buttonized-mime-types '("multipart/\\(signed\\|encrypted\\)")
1978 gnus-sorted-header-list '("^From:"
1994 "^Mail-Followup-To:"
1998 "^X-detected-operating-system:"
2003 gnus-visible-headers (mapconcat 'identity
2004 gnus-sorted-header-list
2006 ;; local-lapsed article dates
2007 ;; from https://www.emacswiki.org/emacs/GnusFormatting#toc11
2008 gnus-article-date-headers '(user-defined)
2009 gnus-article-time-format
2011 (let* ((date (format-time-string "%a, %d %b %Y %T %z" time))
2012 (local (article-make-date-line date 'local))
2013 (combined-lapsed (article-make-date-line date
2016 (string-match " (.+" combined-lapsed)
2017 (match-string 0 combined-lapsed))))
2018 (concat local lapsed))))
2020 :map gnus-article-mode-map
2021 ("M-L" . org-store-link)))
2023 (use-package gnus-sum
2024 :bind (:map gnus-summary-mode-map
2025 :prefix-map b/gnus-summary-prefix-map
2027 ("r" . gnus-summary-reply)
2028 ("w" . gnus-summary-wide-reply)
2029 ("v" . gnus-summary-show-raw-article))
2032 :map gnus-summary-mode-map
2033 ("M-L" . org-store-link))
2034 :hook (gnus-summary-mode . b/no-mouse-autoselect-window)
2036 (gnus-thread-sort-functions '(gnus-thread-sort-by-number
2037 gnus-thread-sort-by-subject
2038 gnus-thread-sort-by-date)))
2040 (use-package gnus-msg
2042 (defvar b/shemshak-signature "Amin Bandali
2043 https://shemshak.org/~amin")
2044 (defvar b/uw-signature "Amin Bandali, MMath Student
2045 Cheriton School of Computer Science
2046 University of Waterloo
2047 https://bandali.eu.org")
2048 (defvar b/csc-signature "Amin Bandali
2049 System Administrator, Systems Committee
2050 Computer Science Club, University of Waterloo
2051 https://csclub.uwaterloo.ca/~abandali")
2052 (setq gnus-message-replysign t
2055 (address "bandali@gnu.org"))
2056 ("nnimap\\+gnu:l\\..*"
2059 (organization "GNU"))
2060 ((header "subject" "ThankCRM")
2061 (to "webmasters-comment@gnu.org")
2063 (eval (setq b/message-cite-say-hi nil)))
2064 ("nnimap\\+shemshak:.*"
2065 (address "amin@shemshak.org")
2067 (signature b/shemshak-signature)
2068 (gcc "nnimap+shemshak:Sent")
2069 (eval (setq b/message-cite-say-hi t)))
2071 (address "bandali@uwaterloo.ca")
2073 (signature b/uw-signature))
2074 ("nnimap\\+uw:INBOX"
2075 (gcc "\"nnimap+uw:Sent Items\""))
2077 (address "bandali@csclub.uwaterloo.ca")
2078 (signature b/csc-signature)
2079 (gcc "nnimap+csc:Sent"))))
2080 :hook (gnus-message-setup . (lambda ()
2081 (unless (mml-secure-is-encrypted-p)
2082 (mml-secure-message-sign)))))
2084 (use-package gnus-topic
2085 :hook (gnus-group-mode . gnus-topic-mode)
2086 :config (setq gnus-topic-line-format "%i[ %A: %(%{%n%}%) ]%v\n"))
2088 (use-package gnus-agent
2090 (setq gnus-agent-synchronize-flags 'ask)
2091 :hook (gnus-group-mode . gnus-agent-mode))
2093 (use-package gnus-group
2095 (setq gnus-permanently-visible-groups "\\(:INBOX$\\|:gnu$\\)"))
2098 ;; problematic with ebdb's popup, *EBDB-Gnus*
2099 (use-package gnus-win
2101 (setq gnus-use-full-window nil)))
2103 (use-package gnus-dired
2104 :commands gnus-dired-mode
2106 (add-hook 'dired-mode-hook 'gnus-dired-mode))
2109 (use-package gnus-utils
2111 (gnus-completing-read-function 'gnus-ido-completing-read)))
2113 (use-package mm-decode
2115 (setq mm-discouraged-alternatives '("text/html" "text/richtext")
2116 mm-decrypt-option 'known
2117 mm-verify-option 'known))
2121 (when (version< "27" emacs-version)
2122 (set-face-attribute 'mm-uu-extract nil :extend t))
2124 (mm-uu-diff-groups-regexp
2125 "\\(gmane\\|gnu\\|l\\)\\..*\\(diff\\|commit\\|cvs\\|bug\\|dev\\)"))
2127 (use-package sendmail
2129 (setq sendmail-program (executable-find "msmtp")
2130 ;; message-sendmail-extra-arguments '("-v" "-d")
2131 mail-specify-envelope-from t
2132 mail-envelope-from 'header))
2134 (use-package message
2135 :bind (:map message-mode-map ("<C-return>" . b/insert-asterism))
2137 ;; redefine for a simplified In-Reply-To header
2138 ;; (see https://todo.sr.ht/~sircmpwn/lists.sr.ht/67)
2139 (defun message-make-in-reply-to ()
2140 "Return the In-Reply-To header for this message."
2141 (when message-reply-headers
2142 (let ((from (mail-header-from message-reply-headers))
2143 (msg-id (mail-header-id message-reply-headers)))
2147 (defconst b/message-cite-style-format "On %Y-%m-%d %l:%M %p, %N wrote:")
2148 (defconst message-cite-style-bandali
2149 '((message-cite-function 'message-cite-original)
2150 (message-citation-line-function 'message-insert-formatted-citation-line)
2151 (message-cite-reply-position 'traditional)
2152 (message-yank-prefix "> ")
2153 (message-yank-cited-prefix ">")
2154 (message-yank-empty-prefix ">")
2155 (message-citation-line-format
2156 (if b/message-cite-say-hi
2157 (concat "Hi %F,\n\n" b/message-cite-style-format)
2158 b/message-cite-style-format)))
2159 "Citation style based on Mozilla Thunderbird's. Use with message-cite-style.")
2160 (setq ;; message-cite-style 'message-cite-style-bandali
2161 message-kill-buffer-on-exit t
2162 message-send-mail-function 'message-send-mail-with-sendmail
2163 message-sendmail-envelope-from 'header
2164 message-subscribed-address-functions
2165 '(gnus-find-subscribed-addresses)
2166 message-dont-reply-to-names
2167 "\\(\\(amin@shemshak\\.org\\)\\|\\(.*@aminb\\.org\\)\\|\\(\\(bandali\\|mab\\|aminb?\\)@gnu\\.org\\)\\|\\(a?bandali@\\(csclub\\.\\)?uwaterloo\\.ca\\)\\)")
2168 ;; (require 'company-ebdb)
2169 :hook (;; (message-setup . mml-secure-message-sign-pgpmime)
2170 (message-mode . flyspell-mode)
2171 (message-mode . (lambda ()
2172 ;; (setq-local fill-column b/fill-column
2173 ;; message-fill-column b/fill-column)
2174 (make-local-variable 'company-idle-delay)
2175 (setq company-idle-delay 0.2))))
2177 ;; (message-header-subject ((t (:foreground "#111" :weight semi-bold))))
2178 ;; (message-header-to ((t (:foreground "#111" :weight normal))))
2179 ;; (message-header-cc ((t (:foreground "#333" :weight normal))))
2181 (message-elide-ellipsis "[...]\n"))
2185 (use-package mml-sec
2187 (mml-secure-openpgp-encrypt-to-self t)
2188 (mml-secure-openpgp-sign-with-sender t))
2190 (use-package footnote
2193 ;; (setq footnote-start-tag ""
2194 ;; footnote-end-tag ""
2195 ;; footnote-style 'unicode)
2197 (:map message-mode-map
2198 :prefix-map b/footnote-prefix-map
2200 ("a" . footnote-add-footnote)
2201 ("b" . footnote-back-to-message)
2202 ("c" . footnote-cycle-style)
2203 ("d" . footnote-delete-footnote)
2204 ("g" . footnote-goto-footnote)
2205 ("r" . footnote-renumber-footnotes)
2206 ("s" . footnote-set-style)))
2211 :bind (:map gnus-group-mode-map ("e" . ebdb))
2213 (setq ebdb-sources (b/var "ebdb"))
2214 (with-eval-after-load 'swiper
2215 (add-to-list 'swiper-font-lock-exclude 'ebdb-mode t)))
2217 (use-package ebdb-com
2220 (use-package ebdb-complete
2223 ;; (setq ebdb-complete-mail 'capf)
2224 (ebdb-complete-enable))
2226 (use-package ebdb-message
2230 ;; (use-package company-ebdb
2232 ;; (defun company-ebdb--post-complete (_) nil))
2234 (use-package ebdb-gnus
2237 (ebdb-gnus-window-size 0.3))
2239 (use-package ebdb-mua
2242 :custom (ebdb-mua-pop-up t))
2244 ;; (use-package ebdb-message
2247 ;; (use-package ebdb-vcard
2250 (use-package message-x)
2253 (use-package message-x
2255 (message-x-completion-alist
2257 (("\\([rR]esent-\\|[rR]eply-\\)?[tT]o:\\|[bB]?[cC][cC]:" . gnus-harvest-find-address)
2260 (quote message-newgroups-header-regexp))
2261 message-newgroups-header-regexp message-newsgroups-header-regexp)
2262 . message-expand-group))))))
2265 (use-package gnus-harvest
2266 :commands gnus-harvest-install
2269 (if (featurep 'message-x)
2270 (gnus-harvest-install 'message-x)
2271 (gnus-harvest-install))))
2273 (use-package gnus-article-treat-patch
2278 ;; note: be sure to customize faces with `:foreground "white"' when
2279 ;; using a theme with a white/light background :)
2280 (setq ft/gnus-article-patch-conditions
2281 '("^@@ -[0-9]+,[0-9]+ \\+[0-9]+,[0-9]+ @@")))
2284 ;;; IRC (with ERC and ZNC)
2287 :bind (("C-c b b" . erc-switch-to-buffer)
2289 ("M-a" . erc-track-switch-buffer))
2291 (erc-join-buffer 'bury)
2292 (erc-lurker-hide-list '("JOIN" "PART" "QUIT"))
2293 (erc-nick "bandali")
2295 (erc-rename-buffers t)
2296 (erc-server-reconnect-attempts 5)
2297 (erc-server-reconnect-timeout 3)
2299 (defun erc-cmd-OPME ()
2300 "Request chanserv to op me."
2301 (erc-message "PRIVMSG"
2302 (format "chanserv op %s %s"
2303 (erc-default-target)
2304 (erc-current-nick)) nil))
2305 (defun erc-cmd-DEOPME ()
2306 "Deop myself from current channel."
2307 (erc-cmd-DEOP (format "%s" (erc-current-nick))))
2308 (add-to-list 'erc-modules 'keep-place)
2309 (add-to-list 'erc-modules 'notifications)
2310 (add-to-list 'erc-modules 'smiley)
2311 (add-to-list 'erc-modules 'spelling)
2312 (add-to-list 'erc-modules 'scrolltoplace)
2313 (erc-update-modules))
2315 (use-package erc-fill
2318 (erc-fill-column 77)
2319 (erc-fill-function 'erc-fill-static)
2320 (erc-fill-static-center 18))
2322 (use-package erc-pcomplete
2325 (erc-pcomplete-nick-postfix ", "))
2327 (use-package erc-track
2329 :bind (("C-c a e t d" . erc-track-disable)
2330 ("C-c a e t e" . erc-track-enable))
2332 (erc-track-enable-keybindings nil)
2333 (erc-track-exclude-types '("JOIN" "MODE" "NICK" "PART" "QUIT"
2334 "324" "329" "332" "333" "353" "477"))
2335 (erc-track-position-in-mode-line t)
2336 (erc-track-priority-faces-only 'all)
2337 (erc-track-shorten-function nil))
2339 (use-package erc-hl-nicks
2342 (use-package erc-scrolltoplace
2346 :bind (("C-c a e e" . znc-erc)
2347 ("C-c a e a" . znc-all))
2349 (let ((pwd (let ((auth (auth-source-search :host "znca")))
2351 ((null auth) (error "Couldn't find znca's authinfo"))
2352 (t (funcall (plist-get (car auth) :secret)))))))
2354 `(("znc.shemshak.org" 1337 t
2355 ((freenode "amin/freenode" ,pwd)))
2356 ("znc.shemshak.org" 1337 t
2357 ((oftc "amin/oftc" ,pwd)))))))
2360 ;;; Post initialization
2363 (message "Loading %s...done (%.3fs)" user-init-file
2364 (float-time (time-subtract (current-time)
2365 b/before-user-init-time)))
2367 ;;; init.el ends here