X-Git-Url: https://git.shemshak.org/~bandali/configs/blobdiff_plain/0f4b61b6a2164eaa6b7dbcac3eb4752487563895..b886644f2f78b29c762db4b4f5ae80dd34f7b430:/.emacs.d/init.el diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 7b8cf94..7a9c143 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -184,6 +184,9 @@ ;;; Initial setup +(defvar b/exwm-p (string= (system-name) "jirud") + "Whether or not we will be using `exwm'.") + ;; keep ~/.emacs.d clean (use-package no-littering :demand @@ -263,6 +266,10 @@ (previous-line) (insert "\n \n;;; ")) +(defun b/insert-asterism () + (interactive) + (insert "\n\n * * *\n\n")) + (defun b/no-mouse-autoselect-window () "Conveniently disable `focus-follows-mouse'. For disabling the behaviour for certain buffers and/or modes." @@ -394,7 +401,7 @@ For disabling the behaviour for certain buffers and/or modes." ;; time and battery in mode-line (use-feature time - :disabled + :if b/exwm-p :demand :config (display-time-mode) @@ -403,7 +410,7 @@ For disabling the behaviour for certain buffers and/or modes." (display-time-format "%a %b %-e, %-l:%M%P")) (use-feature battery - :disabled + :if b/exwm-p :demand :config (display-battery-mode) @@ -465,6 +472,11 @@ For disabling the behaviour for certain buffers and/or modes." (use-feature vc :bind ("C-x v C-=" . vc-ediff)) +(use-feature vc-git + :after vc + :custom + (vc-git-print-log-follow t)) + (use-feature ediff :config (add-hook 'ediff-after-quit-hook-internal 'winner-undo) :custom ((ediff-window-setup-function 'ediff-setup-windows-plain) @@ -568,7 +580,7 @@ For disabling the behaviour for certain buffers and/or modes." ;;; Essential packages (use-package exwm - :disabled + :if b/exwm-p :demand :config ;; make class name the buffer name, truncating beyond 60 characters @@ -764,18 +776,7 @@ around if needed." :config (exwm-randr-enable) :custom - (exwm-randr-workspace-monitor-plist '(1 "VGA-1")) - :hook - (exwm-randr-screen-change . (lambda () - (let ((xrandr - (string-join - '("xrandr" - "--output VGA-1" - "--same-as LVDS-1" - "--auto") - " "))) - (start-process-shell-command - "xrandr" nil xrandr))))) + (exwm-randr-workspace-monitor-plist '(1 "VGA-1"))) (use-feature exwm-systemtray :demand @@ -970,7 +971,6 @@ This function is intended for use with `ivy-ignore-buffers'." :after ivy :bind (([remap execute-extended-command] . counsel-M-x) ([remap find-file] . counsel-find-file) - ("C-c b b" . ivy-switch-buffer) ("C-c f ." . counsel-find-file) ("C-c f l" . counsel-find-library) ("C-c f r" . counsel-recentf) @@ -1248,6 +1248,7 @@ This function is intended for use with `ivy-ignore-buffers'." (add-hook 'prog-mode-hook #'indicate-buffer-boundaries-left)) (use-feature text-mode + :bind (:map text-mode-map ("C-*" . b/insert-asterism)) :hook (text-mode . indicate-buffer-boundaries-left)) (use-feature conf-mode @@ -1257,7 +1258,6 @@ This function is intended for use with `ivy-ignore-buffers'." :mode "\\.bashrc$") (use-package company - :defer 0.6 :bind (:map company-active-map ([tab] . company-complete-common-or-cycle) @@ -1572,7 +1572,11 @@ This function is intended for use with `ivy-ignore-buffers'." (load-theme 'tangomod t) (sml/apply-theme 'tangomod) (font-lock-remove-keywords - 'org-mode b/org-mode-font-lock-keywords)) + 'org-mode b/org-mode-font-lock-keywords) + (when (featurep 'erc-hl-nicks) + (erc-hl-nicks-reset-face-table)) + (when (featurep 'exwm-systemtray) + (exwm-systemtray--refresh))) (defun b/lights-off () "Go dark." @@ -1581,7 +1585,11 @@ This function is intended for use with `ivy-ignore-buffers'." (load-theme 'doom-one t) (sml/apply-theme 'automatic) (font-lock-add-keywords - 'org-mode b/org-mode-font-lock-keywords t)) + 'org-mode b/org-mode-font-lock-keywords t) + (when (featurep 'erc-hl-nicks) + (erc-hl-nicks-reset-face-table)) + (when (featurep 'exwm-systemtray) + (exwm-systemtray--refresh))) (bind-keys ("C-c t d" . b/lights-off) @@ -1604,11 +1612,18 @@ This function is intended for use with `ivy-ignore-buffers'." "C-c 8 -" "typo/dashes" "C-c 8 <" "typo/left-brackets" "C-c 8 >" "typo/right-brackets" + "C-x RET" "coding system" "C-x 8" "unicode" + "C-x @" "event modifiers" "C-x a" "abbrev/expand" "C-x r" "rectangle/register/bookmark" + "C-x t" "tabs" "C-x v" "version control" + "C-x X" "edebug" + "C-x C-a" "edebug" + "C-x C-k" "kmacro" ;; prefixes for my personal bindings + "C-c &" "yasnippet" "C-c a" "applications" "C-c a e" "erc" "C-c a o" "org" @@ -1625,6 +1640,10 @@ This function is intended for use with `ivy-ignore-buffers'." "C-c P s" "projectile/search" "C-c P x" "projectile/execute" "C-c P 4" "projectile/other-window" + "C-c p" "package management" + "C-c ps" "straight" + "C-c psa" "all" + "C-c psp" "package" "C-c q" "boxquote" "C-c t" "themes" ;; "s-O" "outline" @@ -1904,11 +1923,18 @@ This function is intended for use with `ivy-ignore-buffers'." (use-feature window :bind - (("C-c w " . split-window-right) - ("C-c w " . split-window-below) - ("C-c w s l" . split-window-right) - ("C-c w s j" . split-window-below) - ("C-c w q" . quit-window)) + (("C-c w s l" . b/split-window-right) + ("C-c w s j" . b/split-window-below) + ("C-c w q" . quit-window)) + :init + (defun b/split-window-right () + (interactive) + (split-window-right) + (other-window 1)) + (defun b/split-window-below () + (interactive) + (split-window-below) + (other-window 1)) :custom (split-width-threshold 150)) @@ -1938,7 +1964,9 @@ This function is intended for use with `ivy-ignore-buffers'." ("" . pdf-history-forward) ("" . pdf-history-forward) ("" . pdf-history-forward) - ("M-RET" . image-previous-line)) + ("M-RET" . image-previous-line) + ("C-s" . isearch-forward) + ("s s" . isearch-forward)) :config (pdf-tools-install nil t) :custom (pdf-view-resize-factor 1.05)) @@ -1995,6 +2023,29 @@ This function is intended for use with `ivy-ignore-buffers'." :custom (nnreddit-python-command "python3")) +(use-package hyperbole + :disabled + :straight (hyperbole + :host github :repo "rswgnu/hyperbole" + :files ("*.el" ("kotl" "kotl/*.el") + "DEMO" "man/*.info" "man/*.texi"))) + +(use-package oddmuse-curl + :straight (:host github :repo "kensanata/oddmuse-curl") + :config + (setq + oddmuse-wikis + (append + '(("EmacsConf" "https://emacsconf.org" utf-8 "question" nil) + ("EmacsConf 2019" "https://emacsconf.org/2019" utf-8 "question" nil)) + oddmuse-wikis)) + :custom + (oddmuse-username "bandali")) + +(use-package debpaste + :custom + (debpaste-paste-is-hidden t)) + ;;; Email (with Gnus) @@ -2098,6 +2149,9 @@ This function is intended for use with `ivy-ignore-buffers'." ("l\\.emacs-tangents" (to-address . "emacs-tangents@gnu.org") (to-list . "emacs-tangents@gnu.org")) + ("l\\.emacsconf-committee" + (to-address . "emacsconf-committee@gnu.org") + (to-list . "emacsconf-committee@gnu.org")) ("l\\.emacsconf-discuss" (to-address . "emacsconf-discuss@gnu.org") (to-list . "emacsconf-discuss@gnu.org")) @@ -2233,13 +2287,34 @@ This function is intended for use with `ivy-ignore-buffers'." :config (setq gnus-buttonized-mime-types '("multipart/\\(signed\\|encrypted\\)") - gnus-visible-headers - (concat gnus-visible-headers "\\|^List-Id:\\|^X-RT-Originator:\\|^User-Agent:") - gnus-sorted-header-list - '("^From:" "^Subject:" "^Summary:" "^Keywords:" - "^Followup-To:" "^To:" "^Cc:" "X-RT-Originator" - "^Newsgroups:" "List-Id:" "^Organization:" - "^User-Agent:" "^Date:") + gnus-sorted-header-list '("^From:" + "^X-RT-Originator" + "^Newsgroups:" + "^Subject:" + "^Date:" + "^Envelope-To:" + "^Followup-To:" + "^Reply-To:" + "^Organization:" + "^Summary:" + "^Abstract:" + "^Keywords:" + "^To:" + "^[BGF]?Cc:" + "^Posted-To:" + "^Mail-Copies-To:" + "^Mail-Followup-To:" + "^Apparently-To:" + "^Resent-From:" + "^User-Agent:" + "^X-detected-operating-system:" + "^Message-ID:" + "^References:" + "^List-Id:" + "^Gnus-Warning:") + gnus-visible-headers (mapconcat 'identity + gnus-sorted-header-list + "\\|") ;; local-lapsed article dates ;; from https://www.emacswiki.org/emacs/GnusFormatting#toc11 gnus-article-date-headers '(user-defined) @@ -2276,14 +2351,12 @@ This function is intended for use with `ivy-ignore-buffers'." (use-feature gnus-msg :config - (defvar b/signature "Amin Bandali -Free Software Activist | GNU Webmaster & Volunteer -GPG: BE62 7373 8E61 6D6D 1B3A 08E8 A21A 0202 4881 6103 -https://shemshak.org/~amin") (defvar b/gnu-signature "Amin Bandali -Free Software Activist | GNU Webmaster & Volunteer +Free Software Activist | GNU Maintainer & Webmaster GPG: BE62 7373 8E61 6D6D 1B3A 08E8 A21A 0202 4881 6103 https://bandali.eu.org") + (defvar b/shemshak-signature "Amin Bandali +https://shemshak.org/~amin") (defvar b/uw-signature "Amin Bandali, MMath Student Cheriton School of Computer Science University of Waterloo @@ -2292,30 +2365,35 @@ https://bandali.eu.org") Systems Committee Computer Science Club, University of Waterloo https://csclub.uwaterloo.ca/~abandali") - (setq gnus-posting-styles + (setq gnus-message-replysign t + gnus-posting-styles '((".*" (address "bandali@gnu.org") - (signature b/gnu-signature) - (eval (set (make-local-variable 'message-user-fqdn) "fencepost.gnu.org"))) + (signature b/gnu-signature)) + ("nnimap\\+gnu:l\\..*" + (signature nil)) + ((header "subject" "ThankCRM") + (to "webmasters-comment@gnu.org") + (body "") + (eval (setq b/message-cite-say-hi nil))) ("nnimap\\+shemshak:.*" (address "amin@shemshak.org") (body "\nBest,\n") - (signature b/signature) + (signature b/shemshak-signature) (gcc "nnimap+shemshak:Sent") (eval (setq b/message-cite-say-hi t))) - ((header "subject" "ThankCRM") - (to "webmasters-comment@gnu.org") - (body "") - (eval (setq b/message-cite-say-hi nil))) ("nnimap\\+uw:.*" (address "bandali@uwaterloo.ca") + (body "\nBest,\n") (signature b/uw-signature)) ("nnimap\\+uw:INBOX" (gcc "\"nnimap+uw:Sent Items\"")) ("nnimap\\+csc:.*" (address "bandali@csclub.uwaterloo.ca") (signature b/csc-signature) - (gcc "nnimap+csc:Sent"))))) + (gcc "nnimap+csc:Sent")))) + ;; :hook (gnus-message-setup . mml-secure-message-sign) + ) (use-feature gnus-topic :hook (gnus-group-mode . gnus-topic-mode) @@ -2360,6 +2438,7 @@ https://csclub.uwaterloo.ca/~abandali") mail-envelope-from 'header)) (use-feature message + :bind (:map message-mode-map ("" . b/insert-asterism)) :config ;; redefine for a simplified In-Reply-To header ;; (see https://todo.sr.ht/~sircmpwn/lists.sr.ht/67) @@ -2454,7 +2533,6 @@ https://csclub.uwaterloo.ca/~abandali") (defun company-ebdb--post-complete (_) nil)) (use-feature ebdb-gnus - :demand :after ebdb :custom (ebdb-gnus-window-size 0.3)) @@ -2507,7 +2585,7 @@ https://csclub.uwaterloo.ca/~abandali") ;;; IRC (with ERC and ZNC) (use-feature erc - :bind (("C-c b e" . erc-switch-to-buffer) + :bind (("C-c b b" . erc-switch-to-buffer) :map erc-mode-map ("M-a" . erc-track-switch-buffer)) :custom