1 ;;; init.el --- Amin Bandali's Emacs config -*- 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 ;; Emacs configuration of Amin Bandali, computer scientist, functional
21 ;; programmer, and free software activist. Uses straight.el for
22 ;; purely functional and fully reproducible package management.
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:
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
38 ;;; Emacs initialization
40 (defvar mab
/before-user-init-time
(current-time)
41 "Value of `current-time' when Emacs begins loading `user-init-file'.")
42 (message "Loading Emacs...done (%.3fs)"
43 (float-time (time-subtract mab
/before-user-init-time
46 ;; temporarily increase `gc-cons-threshhold' and `gc-cons-percentage'
47 ;; during startup to reduce garbage collection frequency. clearing
48 ;; `file-name-handler-alist' seems to help reduce startup time too.
49 (defvar mab
/gc-cons-threshold gc-cons-threshold
)
50 (defvar mab
/gc-cons-percentage gc-cons-percentage
)
51 (defvar mab
/file-name-handler-alist file-name-handler-alist
)
52 (setq gc-cons-threshold
(* 400 1024 1024) ; 400 MiB
53 gc-cons-percentage
0.6
54 file-name-handler-alist nil
55 ;; sidesteps a bug when profiling with esup
56 esup-child-profile-require-level
0)
58 ;; set them back to their defaults once we're done initializing
59 (defun mab/post-init
()
60 (setq gc-cons-threshold mab
/gc-cons-threshold
61 gc-cons-percentage mab
/gc-cons-percentage
62 file-name-handler-alist mab
/file-name-handler-alist
))
63 (add-hook 'after-init-hook
#'mab
/post-init
)
65 ;; increase number of lines kept in *Messages* log
66 (setq message-log-max
20000)
68 ;; optionally, uncomment to supress some byte-compiler warnings
69 ;; (see C-h v byte-compile-warnings RET for more info)
70 ;; (setq byte-compile-warnings
71 ;; '(not free-vars unresolved noruntime lexical make-local))
76 (setq user-full-name
"Amin Bandali"
77 user-mail-address
"amin@shemshak.org")
82 ;; useful for commenting out multiple sexps at a time
83 (defmacro comment
(&rest _
)
84 "Comment out one or more s-expressions."
85 (declare (indent defun
))
89 ;;; Package management
91 ;; No package.el (for emacs 26 and before, uncomment the following)
92 ;; Not necessary when using straight.el
93 ;; (C-h v straight-package-neutering-mode RET)
96 (not (featurep 'straight
))
97 (version< emacs-version
"27"))
98 (setq package-enable-at-startup nil
)
99 ;; (package-initialize)
102 ;; for emacs 27 and later, we use early-init.el. see
103 ;; https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=24acb31c04b4048b85311d794e600ecd7ce60d3b
107 ;; Main engine start...
109 (setq straight-repository-branch
"develop"
110 straight-check-for-modifications
'(check-on-save find-when-checking
))
112 (defun mab/bootstrap-straight
()
113 (defvar bootstrap-version
)
114 (let ((bootstrap-file
115 (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory
))
116 (bootstrap-version 5))
117 (unless (file-exists-p bootstrap-file
)
119 (url-retrieve-synchronously
120 "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
121 'silent
'inhibit-cookies
)
122 (goto-char (point-max))
123 (eval-print-last-sexp)))
124 (load bootstrap-file nil
'nomessage
)))
126 ;; Solid rocket booster ignition...
128 (mab/bootstrap-straight
)
132 (setq straight-use-package-by-default t
)
134 (defmacro use-feature
(name &rest args
)
135 "Like `use-package', but with `straight-use-package-by-default' disabled."
136 (declare (indent defun
))
141 (with-eval-after-load 'recentf
142 (add-to-list 'recentf-exclude
143 (expand-file-name "~/.emacs.d/straight/build/")))
145 (defun mab/reload-init
()
148 (setq mab
/file-name-handler-alist file-name-handler-alist
)
149 (load user-init-file nil
'nomessage
)
153 (straight-use-package 'use-package
)
154 (if nil
; set to t when need to debug init
156 (setq use-package-verbose t
157 use-package-expand-minimally nil
158 use-package-compute-statistics t
160 (require 'use-package
))
161 (setq use-package-verbose nil
162 use-package-expand-minimally t
))
164 (setq use-package-always-defer t
)
167 (use-package delight
)
169 ;; for browsing the Emacsmirror package database
172 :commands
(epkg-list-packages epkg-describe-package
)
174 (("C-c p e d" . epkg-describe-package
)
175 ("C-c p e p" . epkg-list-packages
))
177 (setq epkg-repository
"~/.emacs.d/straight/repos/epkgs/")
178 (eval-when-compile (defvar ivy-initial-inputs-alist
))
179 (with-eval-after-load 'ivy
181 'ivy-initial-inputs-alist
'(epkg-describe-package .
"^") t
))))
186 ;; keep ~/.emacs.d clean
187 (use-package no-littering
191 (add-to-list 'savehist-additional-variables
'kill-ring
)
193 (setq auto-save-file-name-transforms
194 `((".*" ,(no-littering-expand-var-file-name "auto-save/") t
))))
196 ;; separate custom file (don't want it mixing with init.el)
200 (setq custom-file
(no-littering-expand-etc-file-name "custom.el"))
201 (when (file-exists-p custom-file
)
203 ;; while at it, treat themes as safe
204 (setf custom-safe-themes t
))
206 ;; load the secrets file if it exists, otherwise show a warning
208 (load (no-littering-expand-etc-file-name "secrets")))
210 ;; better $PATH (and other environment variable) handling
211 (use-package exec-path-from-shell
214 (setq exec-path-from-shell-arguments nil
215 exec-path-from-shell-check-startup-files nil
)
217 (exec-path-from-shell-initialize)
218 ;; while we're at it, let's fix access to our running ssh-agent
219 (exec-path-from-shell-copy-env "SSH_AGENT_PID")
220 (exec-path-from-shell-copy-env "SSH_AUTH_SOCK"))
222 ;; only one custom theme at a time
224 (defadvice load-theme
(before clear-previous-themes activate
)
225 "Clear existing theme settings instead of layering them"
226 (mapc #'disable-theme custom-enabled-themes
)))
228 ;; start up emacs server. see
229 ;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html#Emacs-Server
232 :config
(or (server-running-p) (server-mode)))
236 (dolist (ft (fontset-list))
240 (font-spec :name
"Source Code Pro" :size
14))
244 (font-spec :name
"DejaVu Sans Mono")
251 ;; :name "Symbola monospacified for DejaVu Sans Mono")
257 ;; (font-spec :name "DejaVu Sans Mono")
263 (font-spec :name
"DejaVu Sans Mono" :size
14)
267 ;; gentler font resizing
268 (setq text-scale-mode-step
1.05)
270 ;; focus follows mouse
271 (setq mouse-autoselect-window t
)
273 (defun mab/no-mouse-autoselect-window
()
274 "Conveniently disable `focus-follows-mouse'.
275 For disabling the behaviour for certain buffers and/or modes."
276 (make-local-variable 'mouse-autoselect-window
)
277 (setq mouse-autoselect-window nil
))
280 (setq ;; scroll-margin 1
281 ;; scroll-conservatively 10000
283 scroll-conservatively
10
284 scroll-preserve-screen-position
1)
289 (setq mouse-wheel-scroll-amount
'(1 ((shift) .
1)) ; one line at a time
290 mouse-wheel-progressive-speed nil
; don't accelerate scrolling
291 mouse-wheel-follow-mouse t
)) ; scroll window under mouse
293 (use-feature pixel-scroll
295 :config
(pixel-scroll-mode 1))
297 ;; ask for GPG passphrase in minibuffer
298 (use-feature epg-config
301 ((epg-gpg-program (executable-find "gpg"))
302 (epg-pinentry-mode 'loopback
)))
305 (use-package pinentry
309 (setq pinentry--socket-dir server-socket-dir
)
319 (defmacro mab
/setq-every
(value &rest vars
)
320 "Set all the variables from VARS to value VALUE."
321 (declare (indent defun
) (debug t
))
322 `(progn ,@(mapcar (lambda (x) (list 'setq x value
)) vars
)))
324 (defun mab/start-process
(program &rest args
)
325 "Same as `start-process', but doesn't bother about name and buffer."
326 (let ((process-name (concat program
"_process"))
327 (buffer-name (generate-new-buffer-name
328 (concat program
"_output"))))
329 (apply #'start-process
330 process-name buffer-name program args
)))
332 (defun mab/dired-start-process
(program &optional args
)
333 "Open current file with a PROGRAM."
334 ;; Shell command looks like this: "program [ARGS]... FILE" (ARGS can
335 ;; be nil, so remove it).
336 (apply #'mab
/start-process
338 (remove nil
(list args
(dired-get-file-for-visit)))))
340 (defun mab/add-elisp-section
()
344 (insert "\n\f\n;;; "))
349 ;; time and battery in mode-line
353 (setq display-time-default-load-average nil
)
359 (display-battery-mode)))
362 ;; (fringe-mode '(3 . 1))
365 ;; disable disabled commands
366 (setq disabled-command-function nil
)
368 ;; Save what I copy into clipboard from other applications into Emacs'
369 ;; kill-ring, which would allow me to still be able to easily access
370 ;; it in case I kill (cut or copy) something else inside Emacs before
371 ;; yanking (pasting) what I'd originally intended to.
372 (setq save-interprogram-paste-before-kill t
)
375 (setq enable-recursive-minibuffers t
376 resize-mini-windows t
)
378 ;; lazy-person-friendly yes/no prompts
379 (defalias 'yes-or-no-p
#'y-or-n-p
)
381 ;; i want *scratch* as my startup buffer
382 (setq initial-buffer-choice t
)
384 ;; i don't need the default hint
385 (setq initial-scratch-message nil
)
387 ;; use customizable text-mode as major mode for *scratch*
388 (setq initial-major-mode
'text-mode
)
390 ;; inhibit buffer list when more than 2 files are loaded
391 (setq inhibit-startup-buffer-menu t
)
393 ;; don't need to see the startup screen or the echo area message
394 (advice-add #'display-startup-echo-area-message
:override
#'ignore
)
395 (setq inhibit-startup-screen t
396 inhibit-startup-echo-area-message user-login-name
)
398 ;; more useful frame titles
399 (setq frame-title-format
400 '("" invocation-name
" - "
401 (:eval
(if (buffer-file-name)
402 (abbreviate-file-name (buffer-file-name))
405 ;; backups (C-h v make-backup-files RET)
406 (setq backup-by-copying t
408 delete-old-versions t
)
410 ;; enable automatic reloading of changed buffers and files
411 (global-auto-revert-mode 1)
412 (setq auto-revert-verbose nil
413 global-auto-revert-non-file-buffers nil
)
415 ;; always use space for indentation
418 require-final-newline t
421 ;; enable winner-mode (C-h f winner-mode RET)
424 ;; don't display *compilation* buffer on success. based on
425 ;; https://stackoverflow.com/a/17788551, with changes to use `cl-letf'
426 ;; instead of the now obsolete `flet'.
427 (with-eval-after-load 'compile
428 (defun mab/compilation-finish-function
(buffer outstr
)
429 (unless (string-match "finished" outstr
)
430 (switch-to-buffer-other-window buffer
))
433 (setq compilation-finish-functions
#'mab
/compilation-finish-function
)
437 (defadvice compilation-start
438 (around inhibit-display
439 (command &optional mode name-function highlight-regexp
))
440 (if (not (string-match "^\\(find\\|grep\\)" command
))
441 (cl-letf (((symbol-function 'display-buffer
) #'ignore
))
442 (save-window-excursion ad-do-it
))
444 (ad-activate 'compilation-start
))
446 ;; search for non-ASCII characters: i’d like non-ASCII characters such
447 ;; as ‘’“”«»‹›áⓐ𝒶 to be selected when i search for their ASCII
448 ;; counterpart. shoutout to
449 ;; http://endlessparentheses.com/new-in-emacs-25-1-easily-search-non-ascii-characters.html
450 (setq search-default-mode
#'char-fold-to-regexp
)
451 ;; uncomment to extend this behaviour to query-replace
452 ;; (setq replace-char-fold t)
455 (setq-default cursor-type
'bar
)
457 ;; allow scrolling in Isearch
458 (setq isearch-allow-scroll t
)
460 ;; open read-only file buffers in view-mode
461 ;; (enables niceties like `q' for quit)
462 (setq view-read-only t
)
465 :bind
("C-x v C-=" . vc-ediff
))
468 :config
(add-hook 'ediff-after-quit-hook-internal
'winner-undo
)
469 :custom
((ediff-window-setup-function 'ediff-setup-windows-plain
)
470 (ediff-split-window-function 'split-window-horizontally
)))
478 ("C-c e b" . eval-buffer
)
479 ("C-c e r" . eval-region
)
481 ("C-c e i" . emacs-init-time
)
482 ("C-c e u" . emacs-uptime
)
484 ("C-c F m" . make-frame-command
)
485 ("C-c F d" . delete-frame
)
486 ("C-c F D" . server-edit
)
488 ("C-S-h C" . describe-char
)
489 ("C-S-h F" . describe-face
)
491 ("C-x k" . kill-this-buffer
)
492 ("C-x K" . kill-buffer
)
494 ("s-p" . beginning-of-buffer
)
495 ("s-n" . end-of-buffer
)
497 ("M-O" . facemenu-keymap
)
499 :map emacs-lisp-mode-map
500 ("<C-return>" . mab
/add-elisp-section
))
502 (when (display-graphic-p)
503 (unbind-key "C-z" global-map
))
506 ;; for back and forward mouse keys
507 ("<mouse-8>" . previous-buffer
)
508 ("<drag-mouse-8>" . previous-buffer
)
509 ("<mouse-9>" . next-buffer
)
510 ("<drag-mouse-9>" . next-buffer
)
511 ("<drag-mouse-2>" . kill-this-buffer
)
512 ("<drag-mouse-3>" . ivy-switch-buffer
))
515 :prefix-map mab
/straight-prefix-map
517 ("u" . straight-use-package
)
518 ("f" . straight-freeze-versions
)
519 ("t" . straight-thaw-versions
)
520 ("P" . straight-prune-build
)
521 ("g" . straight-get-recipe
)
522 ("r" . mab
/reload-init
)
523 ;; M-x ^straight-.*-all$
524 ("a c" . straight-check-all
)
525 ("a f" . straight-fetch-all
)
526 ("a m" . straight-merge-all
)
527 ("a n" . straight-normalize-all
)
528 ("a F" . straight-pull-all
)
529 ("a P" . straight-push-all
)
530 ("a r" . straight-rebuild-all
)
531 ;; M-x ^straight-.*-package$
532 ("p c" . straight-check-package
)
533 ("p f" . straight-fetch-package
)
534 ("p m" . straight-merge-package
)
535 ("p n" . straight-normalize-package
)
536 ("p F" . straight-pull-package
)
537 ("p P" . straight-push-package
)
538 ("p r" . straight-rebuild-package
))
541 ;;; Essential packages
543 (use-package auto-compile
546 (auto-compile-on-load-mode)
547 (auto-compile-on-save-mode)
548 (setq auto-compile-display-buffer nil
549 auto-compile-mode-line-counter t
550 auto-compile-source-recreate-deletes-dest t
551 auto-compile-toggle-deletes-nonlib-dest t
552 auto-compile-update-autoloads t
)
553 (add-hook 'auto-compile-inhibit-compile-hook
554 'auto-compile-inhibit-compile-detached-git-head
))
556 ;; use the org-plus-contrib package to get the whole deal
557 (straight-use-package 'org-plus-contrib
)
562 (setq org-src-tab-acts-natively t
563 org-src-preserve-indentation nil
564 org-edit-src-content-indentation
0
565 org-link-email-description-format
"Email %c: %s" ; %.30s
566 org-highlight-latex-and-related
'(entities)
567 org-use-speed-commands t
568 org-startup-folded
'content
569 org-catch-invisible-edits
'show-and-error
571 (add-to-list 'org-structure-template-alist
'("L" .
"src emacs-lisp") t
)
572 (add-to-list 'org-modules
'org-habit
)
574 (("C-c a o a" . org-agenda
)
576 ("M-L" . org-insert-last-stored-link
)
577 ("M-O" . org-toggle-link-display
)
579 :hook
((org-mode . org-indent-mode
)
580 (org-mode . auto-fill-mode
)
581 (org-mode . flyspell-mode
))
583 (org-agenda-files '("~/usr/org/todos/personal.org"
584 "~/usr/org/todos/habits.org"
585 "~/usr/org/todos/masters.org"))
586 (org-agenda-start-on-weekday 0)
587 (org-agenda-time-leading-zero t
)
588 (org-habit-graph-column 44)
589 (org-latex-packages-alist '(("" "listings") ("" "color")))
591 '(org-block-begin-line ((t (:foreground
"#5a5b5a" :background
"#1d1f21"))))
592 '(org-block ((t (:background
"#1d1f21"))))
593 '(org-latex-and-related ((t (:foreground
"#b294bb")))))
595 (use-feature ox-latex
598 (setq org-latex-listings
'listings
599 ;; org-latex-prefer-user-labels t
601 (add-to-list 'org-latex-classes
602 '("IEEEtran" "\\documentclass[11pt]{IEEEtran}"
603 ("\\section{%s}" .
"\\section*{%s}")
604 ("\\subsection{%s}" .
"\\subsection*{%s}")
605 ("\\subsubsection{%s}" .
"\\subsubsection*{%s}")
606 ("\\paragraph{%s}" .
"\\paragraph*{%s}")
607 ("\\subparagraph{%s}" .
"\\subparagraph*{%s}"))
609 (require 'ox-beamer
))
611 (use-feature ox-extra
613 (ox-extras-activate '(latex-header-blocks ignore-headlines
)))
615 ;; asynchronous tangle, using emacs-async to asynchronously tangle an
616 ;; org file. closely inspired by
617 ;; https://github.com/dieggsy/dotfiles/tree/cc10edf7701958eff1cd94d4081da544d882a28c/emacs.d#dotfiles
618 (with-eval-after-load 'org
619 (defvar mab
/show-async-tangle-results nil
620 "Keep *emacs* async buffers around for later inspection.")
622 (defvar mab
/show-async-tangle-time nil
623 "Show the time spent tangling the file.")
625 (defun mab/async-babel-tangle
()
626 "Tangle org file asynchronously."
628 (let* ((file-tangle-start-time (current-time))
629 (file (buffer-file-name))
630 (file-nodir (file-name-nondirectory file
))
631 ;; (async-quiet-switch "-q")
632 (file-noext (file-name-sans-extension file
)))
636 (org-babel-tangle-file ,file
))
637 (unless mab
/show-async-tangle-results
640 (message "Tangled %s%s"
642 (if mab
/show-async-tangle-time
644 (float-time (time-subtract (current-time)
645 ',file-tangle-start-time
)))
647 (message "Tangling %s failed" ,file-nodir
))))))))
650 'safe-local-variable-values
651 '(eval add-hook
'after-save-hook
#'mab
/async-babel-tangle
'append
'local
))
653 ;; *the* right way to do git
656 :bind
(("C-x g" . magit-status
)
657 ("s-g s" . magit-status
)
658 ("s-g l" . magit-log-buffer-file
))
660 (magit-add-section-hook 'magit-status-sections-hook
661 'magit-insert-modules
662 'magit-insert-stashes
664 (setq magit-repository-directories
'(("~/" .
0)
666 (nconc magit-section-initial-visibility-alist
667 '(([unpulled status
] . show
)
668 ([unpushed status
] . show
)))
669 :custom
(magit-display-buffer-function #'magit-display-buffer-fullframe-status-v1
)
670 :custom-face
(magit-diff-file-heading ((t (:weight normal
)))))
672 ;; recently opened files
676 ;; (add-to-list 'recentf-exclude "^/\\(?:ssh\\|su\\|sudo\\)?:")
677 (setq recentf-max-saved-items
2000))
679 ;; smart M-x enhancement (needed by counsel for history)
686 (:map ivy-minibuffer-map
687 ([escape] . keyboard-escape-quit)
688 ([S-up] . ivy-previous-history-element)
689 ([S-down] . ivy-next-history-element)
690 ("DEL" . ivy-backward-delete-char))
694 ivy-use-virtual-buffers t
695 ivy-virtual-abbreviate 'abbreviate
696 ivy-count-format "%d/%d ")
699 ;; (ivy-minibuffer-match-face-2 ((t (:background "#e99ce8" :weight semi-bold))))
700 ;; (ivy-minibuffer-match-face-3 ((t (:background "#bbbbff" :weight semi-bold))))
701 ;; (ivy-minibuffer-match-face-4 ((t (:background "#ffbbff" :weight semi-bold))))
706 :bind (("C-s" . swiper-isearch)
708 ("C-S-s" . isearch-forward)))
713 :bind (([remap execute-extended-command] . counsel-M-x)
714 ([remap find-file] . counsel-find-file)
715 ("C-c x" . counsel-M-x)
716 ("C-c f ." . counsel-find-file)
717 ("C-c f l" . counsel-find-library)
718 ("C-c f r" . counsel-recentf)
719 ("s-." . counsel-find-file)
720 ("s-r" . ivy-switch-buffer)
721 :map minibuffer-local-map
722 ("C-r" . counsel-minibuffer-history))
725 (defalias 'locate #'counsel-locate))
729 :commands (helm-M-x helm-mini helm-resume)
730 :bind (("M-x" . helm-M-x)
731 ("M-y" . helm-show-kill-ring)
732 ("C-x b" . helm-mini)
733 ("C-x C-b" . helm-buffers-list)
734 ("C-x C-f" . helm-find-files)
735 ("C-h r" . helm-info-emacs)
736 ("s-r" . helm-recentf)
737 ("C-s-r" . helm-resume)
739 ("<tab>" . helm-execute-persistent-action)
740 ("C-i" . helm-execute-persistent-action) ; Make TAB work in terminals
741 ("C-z" . helm-select-action)) ; List actions
742 :config (helm-mode 1)))
747 :bind ("C-c a s e" . eshell)
749 (eval-when-compile (defvar eshell-prompt-regexp))
750 (defun mab/eshell-quit-or-delete-char (arg)
752 (if (and (eolp) (looking-back eshell-prompt-regexp nil))
753 (eshell-life-is-too-much)
756 (defun mab/eshell-clear ()
758 (let ((inhibit-read-only t))
762 (defun mab/eshell-setup ()
763 (make-local-variable 'company-idle-delay)
764 (defvar company-idle-delay)
765 (setq company-idle-delay nil)
766 (bind-keys :map eshell-mode-map
767 ("C-d" . mab/eshell-quit-or-delete-char)
768 ("C-S-l" . mab/eshell-clear)
769 ("M-r" . counsel-esh-history)
770 ([tab] . company-complete)))
772 :hook (eshell-mode . mab/eshell-setup)
774 (eshell-hist-ignoredups t)
775 (eshell-input-filter 'eshell-input-filter-initial-space))
779 (("C-x C-b" . ibuffer-other-window)
780 :map ibuffer-mode-map
781 ("P" . ibuffer-backward-filter-group)
782 ("N" . ibuffer-forward-filter-group)
783 ("M-p" . ibuffer-do-print)
784 ("M-n" . ibuffer-do-shell-command-pipe-replace))
786 ;; Use human readable Size column instead of original one
787 (define-ibuffer-column size-h
788 (:name "Size" :inline t)
790 ((> (buffer-size) 1000000) (format "%7.1fM" (/ (buffer-size) 1000000.0)))
791 ((> (buffer-size) 100000) (format "%7.0fk" (/ (buffer-size) 1000.0)))
792 ((> (buffer-size) 1000) (format "%7.1fk" (/ (buffer-size) 1000.0)))
793 (t (format "%8d" (buffer-size)))))
795 (ibuffer-saved-filter-groups
797 ("dired" (mode . dired-mode))
798 ("org" (mode . org-mode))
801 (mode . gnus-group-mode)
802 (mode . gnus-summary-mode)
803 (mode . gnus-article-mode)
804 ;; not really, but...
805 (mode . message-mode)))
823 (mode . emacs-lisp-mode)
825 (mode . haskell-mode)
828 (mode . alloy-mode)))
832 (mode . latex-mode)))
835 (name . "^\\*scratch\\*$")
836 (name . "^\\*Messages\\*$")))
837 ("erc" (mode . erc-mode)))))
839 '((mark modified read-only locked " "
840 (name 18 18 :left :elide)
844 (mode 16 16 :left :elide)
845 " " filename-and-process)
849 :hook (ibuffer . (lambda () (ibuffer-switch-to-saved-filter-groups "default"))))
852 :hook (prog-mode . outline-minor-mode)
853 :delight (outline-minor-mode " outl")
856 outline-minor-mode-map
857 ("<s-tab>" . outline-toggle-children)
858 ("M-p" . outline-previous-visible-heading)
859 ("M-n" . outline-next-visible-heading)
860 :prefix-map mab/outline-prefix-map
862 ("TAB" . outline-toggle-children)
863 ("a" . outline-hide-body)
864 ("H" . outline-hide-body)
865 ("S" . outline-show-all)
866 ("h" . outline-hide-subtree)
867 ("s" . outline-show-subtree)))
870 :custom (ls-lisp-dirs-first t))
874 (setq dired-listing-switches "-alh"
875 ls-lisp-use-insert-directory-program nil)
877 ;; easily diff 2 marked files
878 ;; https://oremacs.com/2017/03/18/dired-ediff/
879 (defun dired-ediff-files ()
882 (defvar ediff-after-quit-hook-internal)
883 (let ((files (dired-get-marked-files))
884 (wnd (current-window-configuration)))
885 (if (<= (length files) 2)
886 (let ((file1 (car files))
887 (file2 (if (cdr files)
891 (dired-dwim-target-directory)))))
892 (if (file-newer-than-file-p file1 file2)
893 (ediff-files file2 file1)
894 (ediff-files file1 file2))
895 (add-hook 'ediff-after-quit-hook-internal
897 (setq ediff-after-quit-hook-internal nil)
898 (set-window-configuration wnd))))
899 (error "no more than 2 files should be marked"))))
902 (setq dired-guess-shell-alist-user
903 '(("\\.pdf\\'" "evince" "zathura" "okular")
904 ("\\.doc\\'" "libreoffice")
905 ("\\.docx\\'" "libreoffice")
906 ("\\.ppt\\'" "libreoffice")
907 ("\\.pptx\\'" "libreoffice")
908 ("\\.xls\\'" "libreoffice")
909 ("\\.xlsx\\'" "libreoffice")
910 ("\\.flac\\'" "mpv")))
911 :bind (:map dired-mode-map
912 ("b" . dired-up-directory)
913 ("e" . dired-ediff-files)
914 ("E" . dired-toggle-read-only)
915 ("\\" . dired-hide-details-mode)
918 (mab/dired-start-process "zathura"))))
919 :hook (dired-mode . dired-hide-details-mode))
923 (temp-buffer-resize-mode)
924 (setq help-window-select t))
928 (add-to-list 'tramp-default-proxies-alist '(nil "\\`root\\'" "/ssh:%h:"))
929 (add-to-list 'tramp-default-proxies-alist '("localhost" nil nil))
930 (add-to-list 'tramp-default-proxies-alist
931 (list (regexp-quote (system-name)) nil nil)))
934 :config (dash-enable-font-lock))
936 (use-package doc-view
937 :bind (:map doc-view-mode-map
938 ("M-RET" . image-previous-line)))
943 ;; highlight uncommitted changes in the left fringe
947 (setq diff-hl-draw-borders nil)
948 (global-diff-hl-mode)
949 :hook (magit-post-refresh . diff-hl-magit-post-refresh))
951 ;; display Lisp objects at point in the echo area
953 :when (version< "25" emacs-version)
955 :config (global-eldoc-mode))
957 ;; highlight matching parens
960 :config (show-paren-mode))
962 (use-feature elec-pair
964 :config (electric-pair-mode))
967 :delight (auto-fill-function " fill")
968 :config (column-number-mode))
970 ;; save minibuffer history
971 (use-feature savehist
972 :config (savehist-mode))
974 ;; automatically save place in files
975 (use-feature saveplace
976 :when (version< "25" emacs-version)
977 :config (save-place-mode))
979 (use-feature prog-mode
980 :config (global-prettify-symbols-mode)
981 (defun indicate-buffer-boundaries-left ()
982 (setq indicate-buffer-boundaries 'left))
983 (add-hook 'prog-mode-hook #'indicate-buffer-boundaries-left))
985 (use-feature text-mode
986 :hook (text-mode . indicate-buffer-boundaries-left))
988 (use-feature conf-mode
998 (:map company-active-map
999 ([tab] . company-complete-common-or-cycle)
1000 ([escape] . company-abort
))
1002 (company-minimum-prefix-length 1)
1003 (company-selection-wrap-around t
)
1004 (company-dabbrev-char-regexp "\\sw\\|\\s_\\|[-_]")
1005 (company-dabbrev-downcase nil
)
1006 (company-dabbrev-ignore-case nil
)
1008 (global-company-mode t
))
1010 (use-package flycheck
1012 :hook
(prog-mode . flycheck-mode
)
1014 (:map flycheck-mode-map
1015 ("M-P" . flycheck-previous-error
)
1016 ("M-N" . flycheck-next-error
))
1018 ;; Use the load-path from running Emacs when checking elisp files
1019 (setq flycheck-emacs-lisp-load-path
'inherit
)
1021 ;; Only flycheck when I actually save the buffer
1022 (setq flycheck-check-syntax-automatically
'(mode-enabled save
))
1023 :custom
(flycheck-mode-line-prefix "flyc"))
1025 (use-feature flyspell
1028 ;; http://endlessparentheses.com/ispell-and-apostrophes.html
1032 ;; ’ can be part of a word
1033 (setq ispell-local-dictionary-alist
1034 `((nil "[[:alpha:]]" "[^[:alpha:]]"
1035 "['\x2019]" nil
("-B") nil utf-8
))
1036 ispell-program-name
(executable-find "hunspell"))
1037 ;; don't send ’ to the subprocess
1038 (defun endless/replace-apostrophe
(args)
1039 (cons (replace-regexp-in-string
1042 (advice-add #'ispell-send-string
:filter-args
1043 #'endless
/replace-apostrophe
)
1045 ;; convert ' back to ’ from the subprocess
1046 (defun endless/replace-quote
(args)
1047 (if (not (derived-mode-p 'org-mode
))
1049 (cons (replace-regexp-in-string
1052 (advice-add #'ispell-parse-output
:filter-args
1053 #'endless
/replace-quote
))
1057 :hook
(text-mode . abbrev-mode
))
1060 ;;; Programming modes
1062 (use-feature lisp-mode
1064 (defun indent-spaces-mode ()
1065 (setq indent-tabs-mode nil
))
1066 (add-hook 'lisp-interaction-mode-hook
#'indent-spaces-mode
))
1069 :delight
(reveal-mode " reveal")
1070 :hook
(emacs-lisp-mode . reveal-mode
))
1072 (use-feature elisp-mode
1073 :delight
(emacs-lisp-mode "Elisp" :major
))
1075 (use-package alloy-mode
1076 :straight
(:host github
:repo
"dwwmmn/alloy-mode")
1078 :config
(setq alloy-basic-offset
2))
1080 (use-package proof-site
; for Coq
1081 :straight proof-general
)
1083 (eval-when-compile (defvar lean-mode-map
))
1084 (use-package lean-mode
1086 :bind
(:map lean-mode-map
1087 ("S-SPC" . company-complete
))
1089 (require 'lean-input
)
1090 (setq default-input-method
"Lean"
1091 lean-input-tweak-all
'(lean-input-compose
1092 (lean-input-prepend "/")
1093 (lean-input-nonempty))
1094 lean-input-user-translations
'(("/" "/")))
1097 (use-package haskell-mode
1099 (setq haskell-indentation-layout-offset
4
1100 haskell-indentation-left-offset
4
1101 flycheck-checker
'haskell-hlint
1102 flycheck-disabled-checkers
'(haskell-stack-ghc haskell-ghc
)))
1106 :commands dante-mode
1107 :hook
(haskell-mode . dante-mode
))
1109 (use-package hlint-refactor
1111 :bind
(:map hlint-refactor-mode-map
1112 ("C-c l b" . hlint-refactor-refactor-buffer
)
1113 ("C-c l r" . hlint-refactor-refactor-at-point
))
1114 :hook
(haskell-mode . hlint-refactor-mode
))
1116 (use-package flycheck-haskell
1117 :after haskell-mode
)
1118 ;; alternative: hs-lint https://github.com/ndmitchell/hlint/blob/20e116a043f2073c57b17b24ae6364b5e433ba7e/data/hs-lint.el
1120 (use-package sgml-mode
1122 (setq sgml-basic-offset
2))
1124 (use-package css-mode
1126 (setq css-indent-offset
2))
1128 (use-package web-mode
1132 web-mode-code-indent-offset
1133 web-mode-css-indent-offset
1134 web-mode-markup-indent-offset
))
1136 (use-package emmet-mode
1137 :after
(:any web-mode css-mode sgml-mode
)
1138 :bind
* (("C-)" . emmet-next-edit-point
)
1139 ("C-(" . emmet-prev-edit-point
))
1141 (unbind-key "C-j" emmet-mode-keymap
)
1142 (setq emmet-move-cursor-between-quotes t
)
1143 :hook
(web-mode css-mode html-mode sgml-mode
))
1146 (use-package meghanada
1148 (:map meghanada-mode-map
1149 (("C-M-o" . meghanada-optimize-import
)
1150 ("C-M-t" . meghanada-import-all
)))
1151 :hook
(java-mode . meghanada-mode
)))
1154 (use-package treemacs
1155 :config
(setq treemacs-never-persist t
))
1157 (use-package yasnippet
1159 ;; (yas-global-mode)
1162 (use-package lsp-mode
1163 :init
(setq lsp-eldoc-render-all nil
1164 lsp-highlight-symbol-at-point nil
)
1169 (use-package company-lsp
1172 (setq company-lsp-cache-candidates t
1173 company-lsp-async t
))
1177 (setq lsp-ui-sideline-update-mode
'point
))
1179 (use-package lsp-java
1181 (add-hook 'java-mode-hook
1183 (setq-local company-backends
(list 'company-lsp
))))
1185 (add-hook 'java-mode-hook
'lsp-java-enable
)
1186 (add-hook 'java-mode-hook
'flycheck-mode
)
1187 (add-hook 'java-mode-hook
'company-mode
)
1188 (add-hook 'java-mode-hook
'lsp-ui-mode
))
1190 (use-package dap-mode
1196 (use-package dap-java
1199 (use-package lsp-java-treemacs
1204 :bind
(:map eclim-mode-map
("S-SPC" . company-complete
))
1205 :hook
((java-mode . eclim-mode
)
1206 (eclim-mode .
(lambda ()
1207 (make-local-variable 'company-idle-delay
)
1208 (defvar company-idle-delay
)
1209 ;; (setq company-idle-delay 0.7)
1210 (setq company-idle-delay nil
))))
1212 (eclim-auto-save nil
)
1213 ;; (eclimd-default-workspace "~/src/eclipse-workspace-exp")
1214 (eclim-executable "~/.p2/pool/plugins/org.eclim_2.8.0/bin/eclim")
1215 (eclim-eclipse-dirs '("~/usr/eclipse/dsl-2018-09/eclipse"))))
1217 (use-package geiser
)
1219 (use-feature geiser-guile
1221 (setq geiser-guile-load-path
"~/src/git/guix"))
1228 (font-latex-fontify-sectioning 'color
)))
1230 (use-package go-mode
)
1232 (use-package po-mode
1234 (po-mode .
(lambda () (run-with-timer 0.1 nil
'View-exit
))))
1239 (add-to-list 'custom-theme-load-path
"~/.emacs.d/lisp")
1240 (load-theme 'tangomod t
)
1242 (use-package smart-mode-line
1243 :commands
(sml/apply-theme
)
1247 (smart-mode-line-enable))
1249 (use-package doom-themes
)
1251 (defvar mab
/org-mode-font-lock-keywords
1252 '(("[ \t]*\\(#\\+\\(BEGIN\\|END\\|begin\\|end\\)_\\(\\S-+\\)\\)[ \t]*\\([^\n:]*\\)"
1253 (1 '(:foreground
"#5a5b5a" :background
"#292b2b") t
) ; directive
1254 (3 '(:foreground
"#81a2be" :background
"#292b2b") t
) ; kind
1255 (4 '(:foreground
"#c5c8c6") t
)))) ; title
1257 (defun mab/lights-on
()
1258 "Enable my favourite light theme."
1260 (mapc #'disable-theme custom-enabled-themes
)
1261 (load-theme 'tangomod t
)
1262 (sml/apply-theme
'automatic
)
1263 (font-lock-remove-keywords
1264 'org-mode mab
/org-mode-font-lock-keywords
))
1266 (defun mab/lights-off
()
1269 (mapc #'disable-theme custom-enabled-themes
)
1270 (load-theme 'doom-tomorrow-night t
)
1271 (sml/apply-theme
'automatic
)
1272 (font-lock-add-keywords
1273 'org-mode mab
/org-mode-font-lock-keywords t
))
1276 ("s-t d" . mab
/lights-off
)
1277 ("s-t l" . mab
/lights-on
))
1280 ;;; Emacs enhancements & auxiliary packages
1283 :config
(setq Man-width
80))
1285 (use-package which-key
1289 (which-key-add-key-based-replacements
1290 ;; prefixes for global prefixes and minor modes
1294 "C-c 8 -" "typo/dashes"
1295 "C-c 8 <" "typo/left-brackets"
1296 "C-c 8 >" "typo/right-brackets"
1298 "C-x a" "abbrev/expand"
1299 "C-x r" "rectangle/register/bookmark"
1300 "C-x v" "version control"
1301 ;; prefixes for my personal bindings
1302 "C-c a" "applications"
1306 "C-c p" "package-management"
1307 ;; "C-c p e" "package-management/epkg"
1308 "C-c p s" "straight.el"
1311 "C-c c" "compile-and-comments"
1316 "C-c m" "multiple-cursors"
1317 "C-c P" "projectile"
1318 "C-c P s" "projectile/search"
1319 "C-c P x" "projectile/execute"
1320 "C-c P 4" "projectile/other-window"
1326 ;; prefixes for major modes
1327 (which-key-add-major-mode-key-based-replacements 'message-mode
1329 (which-key-add-major-mode-key-based-replacements 'org-mode
1330 "C-c C-v" "org-babel")
1331 (which-key-add-major-mode-key-based-replacements 'web-mode
1332 "C-c C-a" "web/attributes"
1333 "C-c C-b" "web/blocks"
1335 "C-c C-e" "web/element"
1336 "C-c C-t" "web/tags")
1340 (which-key-add-column-padding 5)
1341 (which-key-max-description-length 32))
1343 (use-package crux
; results in Waiting for git... [2 times]
1345 :bind
(("C-c b k" . crux-kill-other-buffers
)
1346 ("C-c d" . crux-duplicate-current-line-or-region
)
1347 ("C-c D" . crux-duplicate-and-comment-current-line-or-region
)
1348 ("C-c f c" . crux-copy-file-preserve-attributes
)
1349 ("C-c f d" . crux-delete-file-and-buffer
)
1350 ("C-c f r" . crux-rename-file-and-buffer
)
1351 ("C-c j" . crux-top-join-line
)
1352 ("C-S-j" . crux-top-join-line
)))
1355 :bind
(("C-a" . mwim-beginning-of-code-or-line
)
1356 ("C-e" . mwim-end-of-code-or-line
)
1357 ("<home>" . mwim-beginning-of-line-or-code
)
1358 ("<end>" . mwim-end-of-line-or-code
)))
1360 (use-package projectile
1362 :bind-keymap
("C-c P" . projectile-command-map
)
1366 (defun mab/projectile-mode-line-fun
()
1367 "Report project name and type in the modeline."
1368 (let ((project-name (projectile-project-name))
1369 (project-type (projectile-project-type)))
1371 projectile-mode-line-prefix
1373 (format ":%s" project-type
)
1375 (setq projectile-mode-line-function
'mab
/projectile-mode-line-fun
)
1377 (defun my-projectile-invalidate-cache (&rest _args
)
1378 ;; ignore the args to `magit-checkout'
1379 (projectile-invalidate-cache nil
))
1381 (eval-after-load 'magit-branch
1383 (advice-add 'magit-checkout
1384 :after
#'my-projectile-invalidate-cache
)
1385 (advice-add 'magit-branch-and-checkout
1386 :after
#'my-projectile-invalidate-cache
)))
1388 (projectile-completion-system 'ivy
)
1389 (projectile-mode-line-prefix " proj"))
1391 (use-package helpful
1394 (("C-S-h c" . helpful-command
)
1395 ("C-S-h f" . helpful-callable
) ; helpful-function
1396 ("C-S-h v" . helpful-variable
)
1397 ("C-S-h k" . helpful-key
)
1398 ("C-S-h p" . helpful-at-point
)))
1400 (use-package unkillable-scratch
1403 (unkillable-scratch 1)
1405 (unkillable-buffers '("^\\*scratch\\*$" "^\\*Messages\\*$")))
1408 ;; | make pretty boxed quotes like this
1410 (use-package boxquote
1413 (:prefix-map mab
/boxquote-prefix-map
1415 ("b" . boxquote-buffer
)
1416 ("B" . boxquote-insert-buffer
)
1417 ("d" . boxquote-defun
)
1418 ("F" . boxquote-insert-file
)
1419 ("hf" . boxquote-describe-function
)
1420 ("hk" . boxquote-describe-key
)
1421 ("hv" . boxquote-describe-variable
)
1422 ("hw" . boxquote-where-is
)
1423 ("k" . boxquote-kill
)
1424 ("p" . boxquote-paragraph
)
1425 ("q" . boxquote-boxquote
)
1426 ("r" . boxquote-region
)
1427 ("s" . boxquote-shell-command
)
1428 ("t" . boxquote-text
)
1429 ("T" . boxquote-title
)
1430 ("u" . boxquote-unbox
)
1431 ("U" . boxquote-unbox-region
)
1432 ("y" . boxquote-yank
)
1433 ("M-q" . boxquote-fill-paragraph
)
1434 ("M-w" . boxquote-kill-ring-save
)))
1436 (use-package orgalist
1437 ;; http://lists.gnu.org/archive/html/emacs-orgmode/2019-04/msg00007.html
1440 :hook
(message-mode . orgalist-mode
))
1442 ;; easily type pretty quotes & other typography, like ‘’“”-–—«»‹›
1447 (typo-global-mode 1)
1448 :hook
((text-mode erc-mode
) . typo-mode
))
1450 ;; highlight TODOs in buffers
1451 (use-package hl-todo
1454 (global-hl-todo-mode))
1456 (use-package shrink-path
1460 (defvar user-
@-host
(concat (user-login-name) "@" (system-name) " "))
1461 (defun +eshell
/prompt
()
1462 (let ((base/dir
(shrink-path-prompt default-directory
)))
1463 (concat (propertize user-
@-host
'face
'default
)
1464 (propertize (car base
/dir
)
1465 'face
'font-lock-comment-face
)
1466 (propertize (cdr base
/dir
)
1467 'face
'font-lock-constant-face
)
1468 (propertize "> " 'face
'default
))))
1469 (setq eshell-prompt-regexp
(concat user-
@-host
".*> ")
1470 eshell-prompt-function
#'+eshell
/prompt
))
1472 (use-package eshell-up
1474 :commands eshell-up
)
1476 (use-package multi-term
1478 :bind
(("C-c a s m m" . multi-term
)
1479 ("C-c a s m d" . multi-term-dedicated-toggle
)
1480 ("C-c a s m p" . multi-term-prev
)
1481 ("C-c a s m n" . multi-term-next
)
1483 ("C-c C-j" . term-char-mode
))
1485 (setq multi-term-program
"screen"
1486 multi-term-program-switches
(concat "-c"
1487 (getenv "XDG_CONFIG_HOME")
1489 ;; TODO: add separate bindings for connecting to existing
1490 ;; session vs. always creating a new one
1491 multi-term-dedicated-select-after-open-p t
1492 multi-term-dedicated-window-height
20
1493 multi-term-dedicated-max-window-height
30
1495 '(("C-c C-c" . term-interrupt-subjob
)
1496 ("C-c C-e" . term-send-esc
)
1497 ("C-c C-j" . term-line-mode
)
1499 ;; ("C-y" . term-paste)
1500 ("C-y" . term-send-raw
)
1501 ("M-f" . term-send-forward-word
)
1502 ("M-b" . term-send-backward-word
)
1503 ("M-p" . term-send-up
)
1504 ("M-n" . term-send-down
)
1505 ("M-j" . term-send-raw-meta
)
1506 ("M-y" . term-send-raw-meta
)
1507 ("M-/" . term-send-raw-meta
)
1508 ("M-0" . term-send-raw-meta
)
1509 ("M-1" . term-send-raw-meta
)
1510 ("M-2" . term-send-raw-meta
)
1511 ("M-3" . term-send-raw-meta
)
1512 ("M-4" . term-send-raw-meta
)
1513 ("M-5" . term-send-raw-meta
)
1514 ("M-6" . term-send-raw-meta
)
1515 ("M-7" . term-send-raw-meta
)
1516 ("M-8" . term-send-raw-meta
)
1517 ("M-9" . term-send-raw-meta
)
1518 ("<C-backspace>" . term-send-backward-kill-word
)
1519 ("<M-DEL>" . term-send-backward-kill-word
)
1520 ("M-d" . term-send-delete-word
)
1521 ("M-," . term-send-raw
)
1522 ("M-." . comint-dynamic-complete
))
1523 term-unbind-key-alist
1524 '("C-z" "C-x" "C-c" "C-h"
1528 (use-package page-break-lines
1532 (page-break-lines-max-width fill-column
)
1534 (global-page-break-lines-mode))
1536 (use-package expand-region
1537 :bind
("C-=" . er
/expand-region
))
1539 (use-package multiple-cursors
1541 (("C-S-<mouse-1>" . mc
/add-cursor-on-click
)
1542 (:prefix-map mab
/mc-prefix-map
1544 ("c" . mc
/edit-lines
)
1545 ("n" . mc
/mark-next-like-this
)
1546 ("p" . mc
/mark-previous-like-this
)
1547 ("a" . mc
/mark-all-like-this
))))
1553 (use-package yasnippet
1556 (defconst yas-verbosity-cur yas-verbosity
)
1557 (setq yas-verbosity
2)
1558 (add-to-list 'yas-snippet-dirs
"~/src/git/guix/etc/snippets" t
)
1560 (setq yas-verbosity yas-verbosity-cur
)
1563 (use-package debbugs
1566 :repo
"emacs-straight/debbugs"
1567 :files
(:defaults
"Debbugs.wsdl")))
1569 (use-package org-ref
1571 (mab/setq-every
'("~/usr/org/references.bib")
1572 reftex-default-bibliography
1573 org-ref-default-bibliography
)
1575 org-ref-bibliography-notes
"~/usr/org/notes.org"
1576 org-ref-pdf-directory
"~/usr/org/bibtex-pdfs/"))
1578 ;; ugh, temporary (still better than using the proprietary web app)
1580 :commands
(slack-start)
1582 (eval-when-compile ; silence the byte-compiler
1583 (defvar url-http-data nil
)
1584 (defvar url-http-extra-headers nil
)
1585 (defvar url-http-method nil
)
1586 (defvar url-callback-function nil
)
1587 (defvar url-callback-arguments nil
)
1588 (defvar oauth--token-data nil
))
1589 (setq slack-buffer-emojify t
1590 slack-prefer-current-team t
)
1592 (slack-register-team
1593 :name
"nday-students"
1595 :token nday-students-token
1596 :subscribed-channels
'(general)
1597 :full-and-display-names t
)
1598 (with-eval-after-load 'swiper
1599 (add-to-list 'swiper-font-lock-exclude
'slack-message-buffer-mode t
))
1600 (setq lui-time-stamp-format
"[%Y-%m-%d %H:%M:%S]"
1601 lui-time-stamp-only-when-changed-p t
1602 lui-time-stamp-position
'right
)
1604 (("C-c s s" . slack-start
)
1605 ("C-c s u" . slack-select-unread-rooms
)
1606 ("C-c s b" . slack-select-rooms
)
1607 ("C-c s t" . slack-change-current-team
)
1608 ("C-c s c" . slack-ws-close
)
1610 ("M-p" . slack-buffer-goto-prev-message
)
1611 ("M-n" . slack-buffer-goto-next-message
)
1612 ("C-c e" . slack-message-edit
)
1613 ("C-c k" . slack-message-delete
)
1614 ("C-c C-k" . slack-channel-leave
)
1615 ("C-c r a" . slack-message-add-reaction
)
1616 ("C-c r r" . slack-message-remove-reaction
)
1617 ("C-c r s" . slack-message-show-reaction-users
)
1618 ("C-c p l" . slack-room-pins-list
)
1619 ("C-c p a" . slack-message-pins-add
)
1620 ("C-c p r" . slack-message-pins-remove
)
1621 ("@" . slack-message-embed-mention
)
1622 ("#" . slack-message-embed-channel
)))
1626 :init
(setq alert-default-style
'notifications
))
1628 ;; (use-package fill-column-indicator)
1630 (use-package emojify
1631 :hook
(erc-mode . emojify-mode
))
1635 (("s-o" . other-window
)
1636 ("M-o" . other-window
)
1637 ("s-/ ." . split-window-right
)
1638 ("s-/ ," . split-window-below
)
1639 ("s-/ 0" . delete-window
)
1640 ("s-q" . delete-window
)))
1642 (use-feature windmove
1645 (("s-h" . windmove-left
)
1646 ("s-j" . windmove-down
)
1647 ("s-k" . windmove-up
)
1648 ("s-l" . windmove-right
)
1649 ("s-H" . windmove-swap-states-left
)
1650 ("s-J" . windmove-swap-states-down
)
1651 ("s-K" . windmove-swap-states-up
)
1652 ("s-L" . windmove-swap-states-right
)))
1656 :bind
("C-c a p" . pass
)
1657 :hook
(pass-mode . View-exit
))
1660 ;;; Email (with Gnus)
1662 (defvar mab
/maildir
(expand-file-name "~/mail/"))
1663 (with-eval-after-load 'recentf
1664 (add-to-list 'recentf-exclude mab
/maildir
))
1667 mab
/gnus-init-file
(no-littering-expand-etc-file-name "gnus")
1668 mail-user-agent
'gnus-user-agent
1669 read-mail-command
'gnus
)
1672 :bind
(("s-m" . gnus
)
1673 ("s-M" . gnus-unplugged
))
1676 gnus-select-method
'(nnnil "")
1677 gnus-secondary-select-methods
1678 '((nnimap "shemshak"
1679 (nnimap-stream plain
)
1680 (nnimap-address "127.0.0.1")
1681 (nnimap-server-port 143)
1682 (nnimap-authenticator plain
)
1683 (nnimap-user "amin@shemshak.local"))
1685 (nnimap-stream plain
)
1686 (nnimap-address "127.0.0.1")
1687 (nnimap-server-port 143)
1688 (nnimap-authenticator plain
)
1689 (nnimap-user "bandali@gnu.local")
1690 (nnimap-inbox "INBOX")
1691 (nnimap-split-methods 'nnimap-split-fancy
)
1692 (nnimap-split-fancy (|
1693 ;; (: gnus-registry-split-fancy-with-parent)
1694 ;; (: gnus-group-split-fancy "INBOX" t "INBOX")
1696 (list ".*emacs-devel.gnu.org" "l.gnu.emacs.devel")
1697 (list ".*help-gnu-emacs.gnu.org" "l.gnu.emacs.help")
1698 (list ".*info-gnu-emacs.gnu.org" "l.gnu.emacs.info")
1699 (list ".*emacs-orgmode.gnu.org" "l.gnu.emacs.orgmode")
1700 (list ".*emacs-tangents.gnu.org" "l.gnu.emacs.tangents")
1701 (list ".*emacsconf-discuss.gnu.org" "l.gnu.emacsconf.discuss")
1702 (list ".*fencepost-users.gnu.org" "l.gnu.fencepost.users")
1703 (list ".*gnunet-developers.gnu.org" "l.gnu.gnunet.developers")
1704 (list ".*help-gnunet.gnu.org" "l.gnu.gnunet.help")
1705 (list ".*bug-gnuzilla.gnu.org" "l.gnu.gnuzilla.bug")
1706 (list ".*gnuzilla-dev.gnu.org" "l.gnu.gnuzilla.dev")
1707 (list ".*guile-devel.gnu.org" "l.gnu.guile.devel")
1708 (list ".*guile-user.gnu.org" "l.gnu.guile.user")
1709 (list ".*guix-devel.gnu.org" "l.gnu.guix.devel")
1710 (list ".*help-guix.gnu.org" "l.gnu.guix.help")
1711 (list ".*info-guix.gnu.org" "l.gnu.guix.info")
1712 (list ".*savannah-hackers-public.gnu.org" "l.gnu.savannah.hackers.public")
1713 (list ".*savannah-users.gnu.org" "l.gnu.savannah.users")
1714 (list ".*www-commits.gnu.org" "l.gnu.www.commits")
1715 (list ".*www-discuss.gnu.org" "l.gnu.www.discuss")
1717 (from "webmasters\\(-comment\\)?@gnu\\.org" "webmasters")
1719 (list ".*haskell-art.we.lurk.org" "l.haskell.art")
1720 (list ".*haskell-cafe.haskell.org" "l.haskell.cafe")
1722 (list ".*atreus.freelists.org" "l.atreus")
1723 (list ".*deepspec.lists.cs.princeton.edu" "l.deepspec")
1724 (list ".*notmuch.notmuchmail.org" "l.notmuch")
1725 (list ".*dev.lists.parabola.nu" "l.parabola.dev")
1727 (list ".*~bandali/public-inbox@lists.sr.ht" "l.~bandali.public-inbox")
1728 (list ".*~sircmpwn/sr.ht-admins@lists.sr.ht" "l.~sircmpwn.srht.admins")
1729 (list ".*~sircmpwn/sr.ht-announce@lists.sr.ht" "l.~sircmpwn.srht.announce")
1730 (list ".*~sircmpwn/sr.ht-dev@lists.sr.ht" "l.~sircmpwn.srht.dev")
1731 (list ".*~sircmpwn/sr.ht-discuss@lists.sr.ht" "l.~sircmpwn.srht.discuss")
1734 (nnimap-stream plain
)
1735 (nnimap-address "127.0.0.1")
1736 (nnimap-server-port 143)
1737 (nnimap-authenticator plain
)
1738 (nnimap-user "abandali@uw.local")
1739 (nnimap-inbox "INBOX")
1740 (nnimap-split-methods 'nnimap-split-fancy
)
1741 (nnimap-split-fancy (|
1742 ;; (: gnus-registry-split-fancy-with-parent)
1744 ("subject" "\\(SE\\s-?463\\|Deliverable\\)" "course.se463-s19")
1745 (from "\\(SE\\s-?463\\|Gema\\|Hemant\\|Davood\\|Camilo\\|Reza\\|Michael\\|Sandy\\)" "course.se463-s19")
1749 (nnimap-stream plain
)
1750 (nnimap-address "127.0.0.1")
1751 (nnimap-server-port 143)
1752 (nnimap-authenticator plain
)
1753 (nnimap-user "abandali@csc.uw.local")))
1754 gnus-message-archive-group
"nnimap+shemshak:Sent"
1757 (to-address .
"atreus@freelists.org")
1758 (to-list .
"atreus@freelists.org"))
1760 (to-address .
"deepspec@lists.cs.princeton.edu")
1761 (to-list .
"deepspec@lists.cs.princeton.edu")
1762 (list-identifier .
"\\[deepspec\\]"))
1763 ("l\\.gnu\\.emacs\\.devel"
1764 (to-address .
"emacs-devel@gnu.org")
1765 (to-list .
"emacs-devel@gnu.org"))
1766 ("l\\.gnu\\.emacs\\.help"
1767 (to-address .
"help-gnu-emacs@gnu.org")
1768 (to-list .
"help-gnu-emacs@gnu.org"))
1769 ("l\\.gnu\\.emacs\\.info"
1770 (to-address .
"info-gnu-emacs@gnu.org")
1771 (to-list .
"info-gnu-emacs@gnu.org"))
1772 ("l\\.gnu\\.emacs\\.orgmode"
1773 (to-address .
"emacs-orgmode@gnu.org")
1774 (to-list .
"emacs-orgmode@gnu.org")
1775 (list-identifier .
"\\[O\\]"))
1776 ("l\\.gnu\\.emacs\\.tangents"
1777 (to-address .
"emacs-tangents@gnu.org")
1778 (to-list .
"emacs-tangents@gnu.org"))
1779 ("l\\.gnu\\.emacsconf\\.discuss"
1780 (to-address .
"emacsconf-discuss@gnu.org")
1781 (to-list .
"emacsconf-discuss@gnu.org"))
1782 ("l\\.gnu\\.fencepost\\.users"
1783 (to-address .
"fencepost-users@gnu.org")
1784 (to-list .
"fencepost-users@gnu.org")
1785 (list-identifier .
"\\[Fencepost-users\\]"))
1786 ("l\\.gnu\\.gnunet\\.developers"
1787 (to-address .
"gnunet-developers@gnu.org")
1788 (to-list .
"gnunet-developers@gnu.org")
1789 (list-identifier .
"\\[GNUnet-developers\\]"))
1790 ("l\\.gnu\\.gnunet\\.help"
1791 (to-address .
"help-gnunet@gnu.org")
1792 (to-list .
"help-gnunet@gnu.org")
1793 (list-identifier .
"\\[Help-gnunet\\]"))
1794 ("l\\.gnu\\.gnuzilla\\.bug"
1795 (to-address .
"bug-gnuzilla@gnu.org")
1796 (to-list .
"bug-gnuzilla@gnu.org")
1797 (list-identifier .
"\\[Bug-gnuzilla\\]"))
1798 ("l\\.gnu\\.gnuzilla\\.dev"
1799 (to-address .
"gnuzilla-dev@gnu.org")
1800 (to-list .
"gnuzilla-dev@gnu.org")
1801 (list-identifier .
"\\[Gnuzilla-dev\\]"))
1802 ("l\\.gnu\\.guile\\.devel"
1803 (to-address .
"guile-devel@gnu.org")
1804 (to-list .
"guile-devel@gnu.org"))
1805 ("l\\.gnu\\.guile\\.user"
1806 (to-address .
"guile-user@gnu.org")
1807 (to-list .
"guile-user@gnu.org"))
1808 ("l\\.gnu\\.guix\\.devel"
1809 (to-address .
"guix-devel@gnu.org")
1810 (to-list .
"guix-devel@gnu.org"))
1811 ("l\\.gnu\\.guix\\.help"
1812 (to-address .
"help-guix@gnu.org")
1813 (to-list .
"help-guix@gnu.org"))
1814 ("l\\.gnu\\.guix\\.info"
1815 (to-address .
"info-guix@gnu.org")
1816 (to-list .
"info-guix@gnu.org"))
1817 ("l\\.gnu\\.savannah\\.hackers\\.public"
1818 (to-address .
"savannah-hackers-public@gnu.org")
1819 (to-list .
"savannah-hackers-public@gnu.org"))
1820 ("l\\.gnu\\.savannah\\.users"
1821 (to-address .
"savannah-users@gnu.org")
1822 (to-list .
"savannah-users@gnu.org"))
1823 ("l\\.gnu\\.www\\.commits"
1824 (to-address .
"www-commits@gnu.org")
1825 (to-list .
"www-commits@gnu.org"))
1826 ("l\\.gnu\\.www\\.discuss"
1827 (to-address .
"www-discuss@gnu.org")
1828 (to-list .
"www-discuss@gnu.org"))
1829 ("l\\.haskell\\.art"
1830 (to-address .
"haskell-art@we.lurk.org")
1831 (to-list .
"haskell-art@we.lurk.org")
1832 (list-identifier .
"\\[haskell-art\\]"))
1833 ("l\\.haskell\\.cafe"
1834 (to-address .
"haskell-cafe@haskell.org")
1835 (to-list .
"haskell-cafe@haskell.org")
1836 (list-identifier .
"\\[Haskell-cafe\\]"))
1838 (to-address .
"notmuch@notmuchmail.org")
1839 (to-list .
"notmuch@notmuchmail.org"))
1840 ("l\\.parabola\\.dev"
1841 (to-address .
"dev@lists.parabola.nu")
1842 (to-list .
"dev@lists.parabola.nu")
1843 (list-identifier .
"\\[Dev\\]"))
1844 ("l\\.~bandali\\.public-inbox"
1845 (to-address .
"~bandali/public-inbox@lists.sr.ht")
1846 (to-list .
"~bandali/public-inbox@lists.sr.ht"))
1847 ("l\\.~sircmpwn\\.srht\\.admins"
1848 (to-address .
"~sircmpwn/sr.ht-admins@lists.sr.ht")
1849 (to-list .
"~sircmpwn/sr.ht-admins@lists.sr.ht"))
1850 ("l\\.~sircmpwn\\.srht\\.announce"
1851 (to-address .
"~sircmpwn/sr.ht-announce@lists.sr.ht")
1852 (to-list .
"~sircmpwn/sr.ht-announce@lists.sr.ht"))
1853 ("l\\.~sircmpwn\\.srht\\.dev"
1854 (to-address .
"~sircmpwn/sr.ht-dev@lists.sr.ht")
1855 (to-list .
"~sircmpwn/sr.ht-dev@lists.sr.ht"))
1856 ("l\\.~sircmpwn\\.srht\\.discuss"
1857 (to-address .
"~sircmpwn/sr.ht-discuss@lists.sr.ht")
1858 (to-list .
"~sircmpwn/sr.ht-discuss@lists.sr.ht"))
1860 (to-address .
"webmasters@gnu.org")
1861 (to-list .
"webmasters@gnu.org"))
1868 gnus-large-newsgroup
50
1869 gnus-home-directory
(no-littering-expand-var-file-name "gnus/")
1870 gnus-directory
(concat gnus-home-directory
"news/")
1871 message-directory
(concat gnus-home-directory
"mail/")
1872 nndraft-directory
(concat gnus-home-directory
"drafts/")
1873 gnus-save-newsrc-file nil
1874 gnus-read-newsrc-file nil
1875 gnus-interactive-exit nil
1876 gnus-gcc-mark-as-read t
)
1880 (require 'ebdb-gnus
)
1882 ;; (gnus-registry-initialize)
1884 (with-eval-after-load 'recentf
1885 (add-to-list 'recentf-exclude gnus-home-directory
)))
1887 (use-feature gnus-art
1890 gnus-buttonized-mime-types
'("multipart/\\(signed\\|encrypted\\)")
1891 gnus-visible-headers
1892 (concat gnus-visible-headers
"\\|^List-Id:\\|^X-RT-Originator:\\|^User-Agent:")
1893 gnus-sorted-header-list
1894 '("^From:" "^Subject:" "^Summary:" "^Keywords:"
1895 "^Followup-To:" "^To:" "^Cc:" "X-RT-Originator"
1896 "^Newsgroups:" "List-Id:" "^Organization:"
1897 "^User-Agent:" "^Date:")
1898 ;; local-lapsed article dates
1899 ;; from https://www.emacswiki.org/emacs/GnusFormatting#toc11
1900 gnus-article-date-headers
'(user-defined)
1901 gnus-article-time-format
1903 (let* ((date (format-time-string "%a, %d %b %Y %T %z" time
))
1904 (local (article-make-date-line date
'local
))
1905 (combined-lapsed (article-make-date-line date
1908 (string-match " (.+" combined-lapsed
)
1909 (match-string 0 combined-lapsed
))))
1910 (concat local lapsed
))))
1912 :map gnus-article-mode-map
1913 ("M-L" . org-store-link
)))
1915 (use-feature gnus-sum
1916 :bind
(:map gnus-summary-mode-map
1917 :prefix-map mab
/gnus-summary-prefix-map
1919 ("r" . gnus-summary-reply
)
1920 ("w" . gnus-summary-wide-reply
)
1921 ("v" . gnus-summary-show-raw-article
))
1924 :map gnus-summary-mode-map
1925 ("M-L" . org-store-link
))
1926 :hook
(gnus-summary-mode . mab
/no-mouse-autoselect-window
))
1928 (use-feature gnus-msg
1930 (defvar mab
/signature
"Amin Bandali
1931 Free Software Activist | GNU Webmaster & Volunteer
1932 GPG: BE62 7373 8E61 6D6D 1B3A 08E8 A21A 0202 4881 6103
1933 https://shemshak.org/~amin")
1934 (defvar mab
/uw-signature
"Amin Bandali, MMath Student
1935 Cheriton School of Computer Science
1936 University of Waterloo
1937 https://shemshak.org/~amin")
1938 (defvar mab
/csc-signature
"Amin Bandali
1939 Termcom, Computer Science Club
1940 University of Waterloo
1941 https://shemshak.org/~amin")
1942 (setq gnus-posting-styles
1944 (address "amin@shemshak.org")
1946 (signature mab
/signature
)
1947 (eval (setq mab
/message-cite-say-hi t
)))
1949 (address "bandali@gnu.org")
1950 (organization "GNU Project")
1951 (eval (set (make-local-variable 'message-user-fqdn
) "fencepost.gnu.org")))
1952 ((header "subject" "ThankCRM")
1953 (to "webmasters-comment@gnu.org")
1955 (eval (setq mab
/message-cite-say-hi nil
)))
1957 (address "abandali@uwaterloo.ca")
1958 (organization "University of Waterloo")
1959 (signature mab
/uw-signature
))
1960 ("nnimap\\+uw:INBOX"
1961 (gcc "\"nnimap+uw:Sent Items\""))
1963 (address "abandali@csclub.uwaterloo.ca")
1964 (organization "Computer Science Club, University of Waterloo")
1965 (signature mab
/csc-signature
)
1966 (gcc "nnimap+csc:Sent")))))
1968 (use-feature gnus-topic
1969 :hook
(gnus-group-mode . gnus-topic-mode
)
1970 :config
(setq gnus-topic-line-format
"%i[ %A: %(%{%n%}%) ]%v\n"))
1972 (use-feature gnus-agent
1974 (setq gnus-agent-synchronize-flags
'ask
)
1975 :hook
(gnus-group-mode . gnus-agent-mode
))
1977 (use-feature gnus-group
1979 (setq gnus-permanently-visible-groups
"\\(:INBOX$\\|:gnu$\\)"))
1982 ;; problematic with ebdb's popup, *EBDB-Gnus*
1983 (use-feature gnus-win
1985 (setq gnus-use-full-window nil
)))
1987 (use-feature gnus-dired
1988 :commands gnus-dired-mode
1990 (add-hook 'dired-mode-hook
'gnus-dired-mode
))
1992 (use-feature mm-decode
1994 (setq mm-discouraged-alternatives
'("text/html" "text/richtext")
1995 mm-decrypt-option
'known
1996 mm-verify-option
'known
))
1998 (use-feature sendmail
2000 (setq sendmail-program
(executable-find "msmtp")
2001 ;; message-sendmail-extra-arguments '("-v" "-d")
2002 mail-specify-envelope-from t
2003 mail-envelope-from
'header
))
2005 (use-feature message
2007 ;; redefine for a simplified In-Reply-To header
2008 ;; (see https://todo.sr.ht/~sircmpwn/lists.sr.ht/67)
2009 (defun message-make-in-reply-to ()
2010 "Return the In-Reply-To header for this message."
2011 (when message-reply-headers
2012 (let ((from (mail-header-from message-reply-headers
))
2013 (msg-id (mail-header-id message-reply-headers
)))
2017 (defconst mab
/message-cite-style-format
"On %Y-%m-%d %l:%M %p, %N wrote:")
2018 (defconst message-cite-style-bandali
2019 '((message-cite-function 'message-cite-original
)
2020 (message-citation-line-function 'message-insert-formatted-citation-line
)
2021 (message-cite-reply-position 'traditional
)
2022 (message-yank-prefix "> ")
2023 (message-yank-cited-prefix ">")
2024 (message-yank-empty-prefix ">")
2025 (message-citation-line-format
2026 (if mab
/message-cite-say-hi
2027 (concat "Hi %F,\n\n" mab
/message-cite-style-format
)
2028 mab
/message-cite-style-format
)))
2029 "Citation style based on Mozilla Thunderbird's. Use with message-cite-style.")
2030 (setq ;; message-cite-style 'message-cite-style-bandali
2031 message-kill-buffer-on-exit t
2032 message-send-mail-function
'message-send-mail-with-sendmail
2033 message-sendmail-envelope-from
'header
2034 message-subscribed-address-functions
2035 '(gnus-find-subscribed-addresses)
2036 message-dont-reply-to-names
2037 "\\(\\(\\(amin\\|mab\\)@shemshak\\.org\\)\\|\\(amin@bndl\\.org\\)\\|\\(.*@aminb\\.org\\)\\|\\(\\(bandali\\|mab\\|aminb?\\)@gnu\\.org\\)\\|\\(a\\(min\\.\\)?bandali@uwaterloo\\.ca\\)\\|\\(abandali@csclub\\.uwaterloo\\.ca\\)\\)")
2038 (require 'company-ebdb
)
2039 :hook
(;; (message-setup . mml-secure-message-sign-pgpmime)
2040 (message-mode . flyspell-mode
)
2041 (message-mode .
(lambda ()
2042 ;; (setq fill-column 65
2043 ;; message-fill-column 65)
2044 (make-local-variable 'company-idle-delay
)
2045 (setq company-idle-delay
0.2))))
2047 ;; (message-header-subject ((t (:foreground "#111" :weight semi-bold))))
2048 ;; (message-header-to ((t (:foreground "#111" :weight normal))))
2049 ;; (message-header-cc ((t (:foreground "#333" :weight normal))))
2055 (use-feature mml-sec
2057 (mml-secure-openpgp-encrypt-to-self t
)
2058 (mml-secure-openpgp-sign-with-sender t
))
2060 (use-feature footnote
2063 ;; (setq footnote-start-tag ""
2064 ;; footnote-end-tag ""
2065 ;; footnote-style 'unicode)
2067 (:map message-mode-map
2068 :prefix-map mab
/footnote-prefix-map
2070 ("a" . footnote-add-footnote
)
2071 ("b" . footnote-back-to-message
)
2072 ("c" . footnote-cycle-style
)
2073 ("d" . footnote-delete-footnote
)
2074 ("g" . footnote-goto-footnote
)
2075 ("r" . footnote-renumber-footnotes
)
2076 ("s" . footnote-set-style
)))
2079 :straight
(:host github
:repo
"girzel/ebdb")
2081 :bind
(:map gnus-group-mode-map
("e" . ebdb
))
2083 (setq ebdb-sources
(no-littering-expand-var-file-name "ebdb"))
2084 (with-eval-after-load 'swiper
2085 (add-to-list 'swiper-font-lock-exclude
'ebdb-mode t
)))
2087 (use-feature ebdb-com
2090 ;; (use-package ebdb-complete
2093 ;; (ebdb-complete-enable))
2095 (use-package company-ebdb
2097 (defun company-ebdb--post-complete (_) nil
))
2099 (use-feature ebdb-gnus
2102 (ebdb-gnus-window-configuration
2105 (summary 0.25 point
)
2108 (ebdb-gnus 0.3))))))
2110 (use-feature ebdb-mua
2112 ;; :custom (ebdb-mua-pop-up nil)
2115 ;; (use-package ebdb-message
2119 ;; (use-package ebdb-vcard
2122 (use-package message-x
)
2125 (use-package message-x
2127 (message-x-completion-alist
2129 (("\\([rR]esent-\\|[rR]eply-\\)?[tT]o:\\|[bB]?[cC][cC]:" . gnus-harvest-find-address
)
2132 (quote message-newgroups-header-regexp
))
2133 message-newgroups-header-regexp message-newsgroups-header-regexp
)
2134 . message-expand-group
))))))
2137 (use-package gnus-harvest
2138 :commands gnus-harvest-install
2141 (if (featurep 'message-x
)
2142 (gnus-harvest-install 'message-x
)
2143 (gnus-harvest-install))))
2146 ;;; IRC (with ERC and ZNC)
2149 :bind
(("C-c a e b" . erc-switch-to-buffer
)
2151 ("M-a" . erc-track-switch-buffer
))
2153 (erc-join-buffer 'bury
)
2154 (erc-lurker-hide-list '("JOIN" "PART" "QUIT"))
2155 (erc-nick "bandali")
2156 (erc-rename-buffers t
)
2157 (erc-server-reconnect-attempts 5)
2158 (erc-server-reconnect-timeout 3)
2160 (with-eval-after-load 'ivy
2161 ;; ignore channel buffer names
2162 (add-to-list 'ivy-ignore-buffers
"^#"))
2163 (defun erc-cmd-OPME ()
2164 "Request chanserv to op me."
2165 (erc-message "PRIVMSG"
2166 (format "chanserv op %s %s"
2167 (erc-default-target)
2168 (erc-current-nick)) nil
))
2169 (defun erc-cmd-DEOPME ()
2170 "Deop myself from current channel."
2171 (erc-cmd-DEOP (format "%s" (erc-current-nick))))
2172 (add-to-list 'erc-modules
'keep-place
)
2173 (add-to-list 'erc-modules
'notifications
)
2174 (add-to-list 'erc-modules
'spelling
)
2175 (add-to-list 'erc-modules
'scrolltoplace
)
2176 (erc-update-modules))
2178 (use-feature erc-fill
2181 (erc-fill-function 'erc-fill-static
)
2182 (erc-fill-static-center 18))
2184 (use-feature erc-pcomplete
2187 (erc-pcomplete-nick-postfix ","))
2189 (use-feature erc-track
2192 (erc-track-enable-keybindings nil
)
2193 (erc-track-exclude-types '("JOIN" "MODE" "NICK" "PART" "QUIT"
2194 "324" "329" "332" "333" "353" "477"))
2195 (erc-track-priority-faces-only 'all
)
2196 (erc-track-shorten-function nil
))
2198 (use-package erc-hl-nicks
2201 (use-package erc-scrolltoplace
2205 :straight
(:host nil
:repo
"https://git.shemshak.org/amin/znc.el")
2206 :bind
(("C-c a e e" . znc-erc
)
2207 ("C-c a e a" . znc-all
))
2209 (let ((pwd (let ((auth (auth-source-search :host
"znca")))
2211 ((null auth
) (error "Couldn't find znca's authinfo"))
2212 (t (funcall (plist-get (car auth
) :secret
)))))))
2214 `(("znc.shemshak.org" 1337 t
2215 ((freenode "amin/freenode" ,pwd
)))
2216 ("znc.shemshak.org" 1337 t
2217 ((moznet "amin/moznet" ,pwd
)))
2218 ("znc.shemshak.org" 1337 t
2219 ((oftc "amin/oftc" ,pwd
)))))))
2222 ;;; Post initialization
2224 (message "Loading %s...done (%.3fs)" user-init-file
2225 (float-time (time-subtract (current-time)
2226 mab
/before-user-init-time
)))
2228 ;;; init.el ends here