config

Personal configuration.
git clone git://code.dwrz.net/config
Log | Files | Refs

commit 5496fadad74f106e94eb2b83a0d3d7b98033bc90
parent 0ebee8845979709fb8e1895959801d83456d2508
Author: dwrz <dwrz@dwrz.net>
Date:   Fri, 22 Dec 2023 15:29:24 +0000

Update Emacs init

Diffstat:
Memacs/init.el | 49+++++++++++++++++++------------------------------
1 file changed, 19 insertions(+), 30 deletions(-)

diff --git a/emacs/init.el b/emacs/init.el @@ -81,16 +81,11 @@ (select-window (split-window-vertically (floor (* 0.666 (window-total-height)))))) -(defun dwrz-unfill-paragraph () - "Unfill a paragraph." - (interactive) - (let ((fill-column (point-max))) (fill-paragraph nil))) - -(defun dwrz-unfill-region () - "Unfill a region." - (interactive) - (let ((fill-column (point-max))) - (fill-region (region-beginning) (region-end) nil))) +(defun prot-simple-unfill-region-or-paragraph (&optional beg end) + "Unfill paragraph or, when active, the region. Join all lines in region delimited by BEG and END, if active, while respecting any empty lines (so multiple paragraphs are not joined, just unfilled). If no region is active, operate on the paragraph. The idea is to produce the opposite effect of both `fill-paragraph' and `fill-region'." + (interactive "r") + (let ((fill-column most-positive-fixnum)) + (if (use-region-p) (fill-region beg end) (fill-paragraph)))) ;; Packages (require 'package) @@ -99,7 +94,7 @@ (use-package abbrev :ensure nil :init (abbrev-mode t)) (use-package autorevert - :config (setq auto-revert-verbose nil + :config (setq auto-revert-verbose t global-auto-revert-non-file-buffers t) :init (global-auto-revert-mode t) :ensure nil) @@ -127,8 +122,7 @@ calendar-week-start-day 1 diary-file "~/org/diary.org") (calendar-set-date-style 'iso) - :ensure nil - :functions calendar-set-date-style) + :ensure nil) (use-package cape :init @@ -253,12 +247,12 @@ ("Containerfile\\'" . dockerfile-mode))) (use-package doom-modeline + :defer t :hook (after-init . doom-modeline-mode) - :init (doom-modeline-mode t) :ensure t) (use-package elisp-mode - :config (setq-local indent-tabs-mode nil) + :config (setq-local indent-tabs-mode nil) ;; FIX :hook (emacs-lisp-mode . eldoc-mode) :ensure nil) @@ -267,6 +261,8 @@ (("C-." . embark-act) ("C-," . embark-dwim) ("C-'" . embark-bindings)) + :config + (setq prefix-help-command #'embark-prefix-help-command) :ensure t) (use-package embark-consult @@ -336,15 +332,6 @@ (use-package hydra :ensure t) -(use-package ido - :config (setq ido-default-buffer-method 'selected-window - ido-everywhere t - ido-show-dot-for-dired t - ido-use-virtual-buffers t - ido-enable-flex-matching t) - :defer t - :ensure nil) - (use-package ispell :config (setq ispell-program-name "/usr/bin/aspell" ispell-dictionary "en_US" @@ -373,7 +360,7 @@ (use-package marginalia :custom (marginalia-align 'right) - :init (marginalia-mode t) + :config (marginalia-mode t) :defer t :ensure t) @@ -459,7 +446,7 @@ (:name "all mail" :query "*" :key "a") (:name "todo" :query "tag:todo" :key "t"))) :defer t - :defines notmuch-search-tag notmuch-show-tag) + :functions notmuch-search-tag notmuch-show-tag) (use-package novice :disabled t :ensure nil) @@ -511,7 +498,7 @@ (org-babel-do-load-languages 'org-babel-load-languages '((awk .t ) (calc . t) (C . t) (emacs-lisp . t) (gnuplot . t) (js . t) - (latex . t) (makefile .t )(org . t) (python . t) (plantuml . t) + (makefile .t )(org . t) (python . t) (plantuml . t) (shell . t) (sed .t) (sql . t) (sqlite . t))) :defer t :functions org-redisplay-inline-images @@ -543,7 +530,7 @@ (cond ((string= ctx "all") (setq org-agenda-files (append chimerical-agenda-files dwrz-agenda-files - work-agenda-files))) + eti-agenda-files))) ((string= ctx "chimerical") (setq org-agenda-files chimerical-agenda-files)) ((string= ctx "dwrz") (setq org-agenda-files @@ -774,7 +761,7 @@ (use-package yaml-mode :ensure t) ;; Hydras -;; TODO: add, clean up. +;; TODO: replace with defvar-keymap. (defhydra hydra-cape (:color blue) ("q" nil "quit" :column "quit") ("&" cape-sgml "sgml" :column "cape") @@ -797,11 +784,13 @@ ("c" consult-mark "mark" :column "consult") ("f" consult-find "find" :column "consult") ("g" consult-grep "grep" :column "consult") + ("i" consult-imenu-multi "imenu" :column "consult") ("k" consult-global-mark "mark" :column "consult") ("m" consult-line-multi "line-multi" :column "consult") ("n" consult-notmuch "notmuch" :column "consult") ("o" consult-org-heading "org" :column "consult") ("r" consult-ripgrep "ripgrep" :column "consult") + ("t" consult-outline "outline" :column "consult") ("v" consult-git-grep "git-grep" :column "consult")) (defhydra hydra-exec (:color blue) @@ -839,7 +828,7 @@ ("c" rot13-region "cipher" :column "format") ("d" downcase-region "downcase" :column "format") ("u" upcase-region "upcase" :column "format") - ("U" dwrz-unfill-region "unfill" :column "fill") + ("U" prot-simple-unfill-region-or-paragraph "unfill" :column "fill") ("f" fill-region "fill" :column "fill")) (defhydra hydra-windows (:color pink)