From d7824cacb2bb9d0b9c15fa24e15ac367effec9a5 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 20 Jan 2023 13:14:55 -0600 Subject: meh --- init.el | 121 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 107 insertions(+), 14 deletions(-) (limited to 'init.el') diff --git a/init.el b/init.el index aed189c..864ac1b 100644 --- a/init.el +++ b/init.el @@ -1,6 +1,17 @@ ;;; init.el --- An Emacs of one's own -*- lexical-binding: t -*- + +;; Author: Case Duckworth , with inspo from many others +;; Homepage: https://git.acdw.net/emacs +;; Config-Requires: ((emacs "29.0")) ;; Bankruptcy: 9.4 +;; This configuration is Free Software. Everyone is permitted to do whatever +;; they want with it, without limitation. This software comes without any +;; warranty whatsoever, but with two pieces of advice: +;; +;; - Don't hurt others. +;; - Make good choices. + ;;; Code: (load (locate-user-emacs-file "basics")) ; super basic stuff @@ -106,6 +117,14 @@ :config (fringe-mode '(nil . 0))) +(use-package ispell + :config + (setopt ispell-program-name (choose-executable "ispell" "aspell")) + (add-hook 'before-save-hook + #'+ispell-move-buffer-words-to-dir-locals-hook) + (put 'ispell-buffer-session-localwords 'safe-local-variable + '+ispell-safe-local-p)) + (use-package flyspell :hook org-mode-hook) @@ -164,6 +183,8 @@ (use-package time :config (setopt display-time-format " %H:%M" + display-time-interval 60 + display-time-use-mail-icon t display-time-mail-function (defun +notmuch-new-mail-p () (plist-get (cl-find "inbox+unread" @@ -173,8 +194,24 @@ :test #'equal) :count)) display-time-default-load-average nil) + (with-eval-after-load 'notmuch + (add-hook 'notmuch-after-tag-hook #'display-time-update)) (display-time-mode)) +(use-package tab-bar + :config + (setopt tab-bar-show t + tab-bar-close-button-show t) + ;; (add-to-list 'tab-bar-format 'tab-bar-format-menu-bar) + (add-to-list 'tab-bar-format 'tab-bar-format-align-right :append) + (add-to-list 'tab-bar-format 'tab-bar-format-global :append) + (when (daemonp) + (add-hook 'server-after-make-frame-hook + (defun after-frame@tab-bar () + (tab-bar-mode) + (remove-hook 'server-after-make-frame-hook + #'after-frame@tab-bar))))) + ;;; Applications @@ -265,7 +302,9 @@ With prefix ARG, toggle the value of (use-package filldent :load-path "~/src/emacs/filldent/" - :bind ("M-q" . filldent-dwim)) + :bind ("M-q" . filldent-dwim) + :config + (setopt filldent-fill-modes '(web-mode))) (use-package frowny :load-path "~/src/emacs/frowny/" @@ -338,8 +377,30 @@ With prefix ARG, toggle the value of word-boundary))) (hi-lock-unface-buffer regexp) (highlight-regexp regexp 'font-lock-warning-face)))))) + (add-hook 'jabber-chat-mode-hook + (defun jabber-chat@leave-when-kill () + (add-hook 'kill-buffer-hook + (defun @jabber-leave@kill () + (apply #'jabber-muc-leave (jabber-muc-argument-list))) + nil :local))) (when (fboundp 'jabber-chat-update-focus) - (add-hook 'window-configuration-change-hook #'jabber-chat-update-focus))) + (add-hook 'window-configuration-change-hook #'jabber-chat-update-focus)) + (with-eval-after-load 'consult + (defvar jabber-chat-buffer-source + `( :name "Jabber" + :hidden nil + :narrow ?j + :category buffer + :state ,#'consult--buffer-state + :items ,(lambda () + (mapcar #'buffer-name + (seq-filter (lambda (buf) + (with-current-buffer buf + (eq major-mode 'jabber-chat-mode))) + (buffer-list)))))) + (add-to-list 'consult-buffer-sources 'jabber-chat-buffer-source :append) + (consult-customize + consult-buffer :preview-key (kbd "M-.")))) (use-package keepassxc-shim :load-path "~/src/emacs/keepassxc-shim/" @@ -349,6 +410,14 @@ With prefix ARG, toggle the value of ;;; External packages +(use-package async + :ensure t + :config + ;; https://github.com/jwiegley/emacs-async/issues/64 + ;; (setopt message-send-mail-function #'async-smtpmail-send-it) + (dired-async-mode) + (async-bytecomp-package-mode)) + (use-package trashed :ensure t) @@ -367,11 +436,45 @@ With prefix ARG, toggle the value of :config (minions-mode)) (use-package visual-fill-column + :preface + (defcustom visual-fill-column-widen-amount 4 + "Amount to widen `fill-column' by in `visual-fill-column-mode'." + :type 'natnum + :group 'visual-fill-column) + (defun visual-fill-column--widen/narrow-handle-arg (cols) + (cond + ((null cols) visual-fill-column-widen-amount) + ((listp cols) (* visual-fill-column-widen-amount + (1+ (/ (car cols) 4)))) + ((eq '- cols) (- visual-fill-column-widen-amount)) + (:else cols))) + (defun visual-fill-column-widen (&optional cols) + "Widen `fill-column' by COLS, and re-display. +If COLS is missing or nil, widen by +`visual-fill-column-widen-amount'. When called with a plain +\\[universal-argument], multiply that amount by 1 + the amount of +\\[universal-argument]s. If called with a numerical prefix +argument, widen by that number of columns." + (interactive "P") + (let ((cols (visual-fill-column--widen/narrow-handle-arg cols))) + (cl-incf fill-column cols) + (visual-fill-column-adjust) + (message "Fill-column: %s" fill-column))) + (defun visual-fill-column-narrow (&optional cols) + "Narrow `fill-column' by COLS, then redisplay. +The prefix argument is as in `visual-fill-column-widen' but negated." + (interactive "P") + (let ((cols (visual-fill-column--widen/narrow-handle-arg cols))) + (cl-decf fill-column cols) + (visual-fill-column-adjust) + (message "Fill-column: %s" fill-column))) :ensure t :init (setopt visual-fill-column-center-text t visual-fill-column-extra-text-width '(3 . 3)) :config + (keymap-set visual-fill-column-mode-map "C-x C->" #'visual-fill-column-widen) + (keymap-set visual-fill-column-mode-map "C-x C-<" #'visual-fill-column-narrow) (add-hook 'visual-fill-column-mode-hook #'visual-line-mode) (add-hook 'eww-mode-hook #'visual-fill-column-mode) (advice-add 'text-scale-adjust :after #'visual-fill-column-adjust)) @@ -726,15 +829,5 @@ With PREFIX, prompt to change the current dictionary." (use-package php-mode :ensure t) -(use-package tab-bar - :config - (setopt tab-bar-show t) - (add-to-list 'tab-bar-format 'tab-bar-format-menu-bar) - (add-to-list 'tab-bar-format 'tab-bar-format-align-right :append) - (add-to-list 'tab-bar-format 'tab-bar-format-global :append) - (with-eval-after-load 'notmuch - - ;; (remove-hook 'notmuch-after-tag-hook #'tab-bar-make-keymap-1) - (define-advice notmuch-update-tags (:after (&rest _) update-tab-bar) - (tab-bar--update-tab-bar-lines))) - (tab-bar-mode)) +(use-package rec-mode + :ensure t) -- cgit 1.4.1-21-gabe81