X-Git-Url: https://git.shemshak.org/~bandali/configs/blobdiff_plain/295b1b10b673f0fed28915b16e6d86931bc2f326..d6cdd1fd112d43fe4df3617ca82773debb16be68:/.emacs.d/init.el diff --git a/.emacs.d/init.el b/.emacs.d/init.el index e249f9b..d260380 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -266,9 +266,21 @@ (previous-line) (insert "\n \n;;; ")) +(defvar b/fill-column 47 + "My custom `fill-column'.") + +(defconst b/asterism "* * *") + (defun b/insert-asterism () + "Insert a centred asterism." (interactive) - (insert "\n\n * * *\n\n")) + (insert + (concat + "\n\n" + (make-string (floor (/ (- b/fill-column (length b/asterism)) 2)) + ?\s) + b/asterism + "\n\n"))) (defun b/no-mouse-autoselect-window () "Conveniently disable `focus-follows-mouse'. @@ -301,7 +313,9 @@ For disabling the behaviour for certain buffers and/or modes." scroll-conservatively 10 scroll-preserve-screen-position 1 ;; focus follows mouse - mouse-autoselect-window t) + mouse-autoselect-window t + ;; custom fill-column + fill-column b/fill-column) (setq-default ;; always use space for indentation @@ -543,12 +557,13 @@ For disabling the behaviour for certain buffers and/or modes." ;; for back and forward mouse keys ("" . previous-buffer) ("" . previous-buffer) - ("" . previous-buffer) + ;; ("" . previous-buffer) ("" . next-buffer) ("" . next-buffer) - ("" . next-buffer) - ("" . kill-this-buffer) - ("" . switch-to-buffer)) + ;; ("" . next-buffer) + ;; ("" . kill-this-buffer) + ;; ("" . switch-to-buffer) + ) (bind-keys :prefix-map b/straight-prefix-map @@ -1031,16 +1046,14 @@ This function is intended for use with `ivy-ignore-buffers'." (use-package swiper :demand :after ivy - :bind (("C-s" . swiper-isearch) - ("C-r" . swiper-isearch-backward) - ("C-S-s" . swiper-isearch))) + :bind (("C-S-s" . swiper-isearch))) (use-package counsel - :bind (;; ([remap execute-extended-command] . counsel-M-x) - ;; ([remap find-file] . counsel-find-file) - ("C-c f r" . counsel-recentf) + :demand + :after ivy + :bind (("C-c f r" . counsel-recentf) :map minibuffer-local-map - ("C-r" . counsel-minibuffer-history)) + ("C-r" . counsel-minibuffer-history)) :config (counsel-mode 1) (defalias 'locate #'counsel-locate)) @@ -1088,7 +1101,8 @@ This function is intended for use with `ivy-ignore-buffers'." ("C-S-l" . b/eshell-clear) ("M-r" . counsel-esh-history) ;; ([tab] . company-complete) - )) + :map eshell-hist-mode-map + ("M-r" . counsel-esh-history))) :hook (eshell-mode . b/eshell-setup) :custom @@ -1314,7 +1328,8 @@ This function is intended for use with `ivy-ignore-buffers'." (use-feature text-mode :bind (:map text-mode-map ("C-*" . b/insert-asterism)) - :hook (text-mode . indicate-buffer-boundaries-left)) + :hook ((text-mode . indicate-buffer-boundaries-left) + (text-mode . flyspell-mode))) (use-feature conf-mode :mode "\\.*rc$") @@ -1676,10 +1691,10 @@ This function is intended for use with `ivy-ignore-buffers'." ;; prefixes for global prefixes and minor modes "C-c @" "outline" "C-c !" "flycheck" - "C-c 8" "typo" - "C-c 8 -" "typo/dashes" - "C-c 8 <" "typo/left-brackets" - "C-c 8 >" "typo/right-brackets" + ;; "C-c 8" "typo" + ;; "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" @@ -1737,7 +1752,7 @@ This function is intended for use with `ivy-ignore-buffers'." (use-package crux ; results in Waiting for git... [2 times] :defer 0.4 :bind (("C-c d" . crux-duplicate-current-line-or-region) - ("C-c D" . crux-duplicate-and-comment-current-line-or-region) + ("C-c M-d" . crux-duplicate-and-comment-current-line-or-region) ("C-c f C" . crux-copy-file-preserve-attributes) ("C-c f D" . crux-delete-file-and-buffer) ("C-c f R" . crux-rename-file-and-buffer) @@ -1834,12 +1849,19 @@ This function is intended for use with `ivy-ignore-buffers'." ;; easily type pretty quotes & other typography, like ‘’“”-–—«»‹› (use-package typo + :disabled :defer 0.5 :config (typo-global-mode 1) :hook (((text-mode erc-mode web-mode) . typo-mode) (tex-mode . (lambda ()(typo-mode -1))))) +(use-feature electric + :disabled + :demand + :config + (electric-quote-mode)) + ;; highlight TODOs in buffers (use-package hl-todo :defer 0.5 @@ -1968,7 +1990,19 @@ This function is intended for use with `ivy-ignore-buffers'." :straight (debbugs :host github :repo "emacs-straight/debbugs" - :files (:defaults "Debbugs.wsdl"))) + :files (:defaults "Debbugs.wsdl")) + :bind + (("C-c D d" . debbugs-gnu) + ("C-c D e" . + (lambda () + (interactive) + (setq debbugs-gnu-current-suppress t) + (debbugs-gnu debbugs-gnu-default-severities '("emacs")))) + ("C-c D g" . + (lambda () + (interactive) + (setq debbugs-gnu-current-suppress t) + (debbugs-gnu debbugs-gnu-default-severities '("gnuzilla")))))) (use-package org-ref :init @@ -2156,6 +2190,8 @@ This function is intended for use with `ivy-ignore-buffers'." ;; (: gnus-group-split-fancy "INBOX" t "INBOX") ;; gnu (list ".*<\\(.*\\)\\.\\(non\\)?gnu\\.org>.*" "l.\\1") + ;; gnus + (list ".*<\\(.*\\)\\.gnus\\.org>.*" "l.\\1") ;; *.lists.sr.ht, omitting one dot if present ;; add more \\.?\\([^.]*\\) if needed (list ".*<~\\(.*\\)/\\([^.]*\\)\\.?\\([^.]*\\)\\.lists.sr.ht>.*" "l.~\\1.\\2\\3") @@ -2550,8 +2586,8 @@ https://csclub.uwaterloo.ca/~abandali") :hook (;; (message-setup . mml-secure-message-sign-pgpmime) (message-mode . flyspell-mode) (message-mode . (lambda () - ;; (setq fill-column 65 - ;; message-fill-column 65) + (setq-local fill-column b/fill-column + message-fill-column b/fill-column) (make-local-variable 'company-idle-delay) (setq company-idle-delay 0.2)))) ;; :custom-face @@ -2586,6 +2622,17 @@ https://csclub.uwaterloo.ca/~abandali") ("r" . footnote-renumber-footnotes) ("s" . footnote-set-style))) +(use-package bbdb + :disabled + :demand + :after gnus + :bind (:map gnus-group-mode-map ("e" . bbdb)) + :config + (bbdb-initialize 'gnus 'message) + :custom + (bbdb-complete-mail-allow-cycling t) + (bbdb-user-mail-address-re message-dont-reply-to-names)) + (use-package ebdb :demand :after gnus