config

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

commit 73bee439a73e00b53fafa5a8adef119e41ac9c9e
parent 2a0fd54a3a9ac7f516179d99f6a43e4c657fb392
Author: dwrz <dwrz@dwrz.net>
Date:   Wed, 13 Dec 2023 23:29:27 +0000

Update Emacs init

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

diff --git a/emacs/init.el b/emacs/init.el @@ -1,11 +1,15 @@ -;; Global C source code variables. +;; (setq use-package-compute-statistics t ;; use-package-report +;; garbage-collection-messages t) + (setq auto-save-interval 24 delete-by-moving-to-trash t echo-keystrokes 0.1 enable-recursive-minibuffers t frame-inhibit-implied-resize t + gc-cons-percentage (* gc-cons-percentage 2) next-screen-context-lines 5 load-prefer-newer t + read-process-output-max (* 1024 1024) scroll-conservatively 10000 use-dialog-box nil user-full-name "David Wen Riccardi-Zhu" @@ -53,21 +57,6 @@ (font-lock-add-keywords nil '(("\\<\\(FIX\\|TODO\\|NB\\)" 1 font-lock-warning-face t)))) -(defun dwrz-transpose-line-up () - "Move the current line up." - (interactive) - (transpose-lines 1) - (forward-line -2) - (indent-according-to-mode)) - -(defun dwrz-transpose-line-down () - "Move the current line down." - (interactive) - (forward-line 1) - (transpose-lines 1) - (forward-line -1) - (indent-according-to-mode)) - (defun dwrz-org-capture-at-point () "Insert an org capture template at point." (interactive) @@ -154,10 +143,14 @@ (add-to-list 'completion-at-point-functions #'cape-rfc1345) :ensure t) -(use-package cc-vars :config (setq-default c-basic-offset 8) :ensure nil) +(use-package cc-vars + :config (setq-default c-basic-offset 8) + :defer t + :ensure nil) (use-package compile :config (setq compilation-message-face 'default) + :defer t :ensure nil) (use-package conf-mode :ensure nil) @@ -199,9 +192,9 @@ #'consult-narrow-help) :ensure t) -(use-package consult-lsp :ensure t) +(use-package consult-lsp :defer t :ensure t) -(use-package consult-notmuch :ensure t) +(use-package consult-notmuch :defer t :ensure t) (use-package corfu :bind (:map corfu-map ("RET" . nil)) @@ -230,6 +223,7 @@ :config (setq dired-listing-switches "-alh" dired-recursive-copies 'always) (put 'dired-find-alternate-file 'disabled nil) + :defer t :ensure nil) (use-package dired-hide-dotfiles @@ -240,13 +234,24 @@ :config (setq dired-omit-verbose nil dired-omit-files (concat dired-omit-files "\\|^\\..+$") dired-clean-up-buffers-too t) + :defer t :ensure nil) -(use-package doc-view :config (setq doc-view-resolution 300) :ensure nil) +(use-package doc-view + :config (setq doc-view-resolution 300) + :defer t + :ensure nil) -(use-package dockerfile-mode :ensure t) +(use-package dockerfile-mode + :defer t + :ensure t + :mode (("Dockerfile\\'" . dockerfile-mode) + ("Containerfile\\'" . dockerfile-mode))) -(use-package doom-modeline :init (doom-modeline-mode t) :ensure t) +(use-package doom-modeline + :hook (after-init . doom-modeline-mode) + :init (doom-modeline-mode t) + :ensure t) (use-package elisp-mode :config (setq-local indent-tabs-mode nil) @@ -272,7 +277,7 @@ :foundry "PfEd" :slant 'normal :weight 'normal - :height 160 + :height 190 :width 'normal) :custom (face-font-family-alternatives '(("hans" "adobe-source-han-sans-cn-font")))) @@ -333,6 +338,7 @@ ido-show-dot-for-dired t ido-use-virtual-buffers t ido-enable-flex-matching t) + :defer t :ensure nil) (use-package ispell @@ -343,6 +349,7 @@ ispell-dictionary-alist '(("en_US" "[[:alpha:]]" "[^[:alpha:]]" "['‘’]" t ("-d" "en_US") nil utf-8))) + :defer t :ensure t) (use-package jka-cmpr-hook :init (auto-compression-mode t) :ensure nil) @@ -351,7 +358,7 @@ :config (setq js-indent-level 2) :defines js-indent-level :hook ((js-mode . lsp) - (js-mode . (lambda () (setq indent-tabs-mode nil)))) + (js-mode . (lambda () (setq indent-tabs-mode nil)))) :ensure nil) (use-package ledger-mode :defer t :ensure t) @@ -379,6 +386,13 @@ :defer t :ensure nil) +(use-package move-text + :bind + (("<M-up>" . move-text-up) + ("<M-down>" . move-text-down)) + :defer nil + :ensure t) + (use-package mule :config (prefer-coding-system 'utf-8) @@ -403,7 +417,8 @@ :bind (("C-x m" . notmuch) :map notmuch-search-mode-map ("D" . (lambda () "mark message as deleted" (interactive) - (notmuch-search-tag (list "-new" "-unread" "-inbox" "+deleted")) + (notmuch-search-tag (list "-new" "-unread" "-inbox" + "+deleted")) (forward-line))) ("S" . (lambda () "mark message as spam" (interactive) (notmuch-search-tag (list "-new" "-unread" "-inbox" "+spam")) @@ -439,6 +454,7 @@ (:name "drafts" :query "tag:draft" :key "d") (:name "all mail" :query "*" :key "a") (:name "todo" :query "tag:todo" :key "t"))) + :defer t :defines notmuch-search-tag notmuch-show-tag) (use-package novice :disabled t :ensure nil) @@ -545,6 +561,7 @@ org-agenda-use-time-grid nil org-agenda-window-setup 'current-window org-archive-location "~/org/archive.org::") + :defer t :defines chimerical-agenda-files dwrz-agenda-files eti-agenda-files :functions dwrz-switch-org-ctx :ensure nil) @@ -592,6 +609,7 @@ ("DELEGATED" . "#969896") ("CANCELED" . "#a3685a") ("SOMEDAY-MAYBE" . "#8959a8"))) + :defer t :ensure nil) (use-package org-src @@ -612,6 +630,7 @@ (use-package plantuml-mode :config (setq org-plantuml-jar-path (expand-file-name "/usr/share/java/plantuml/plantuml.jar")) + :defer t :defines org-plantuml-jar-path :ensure t) @@ -619,7 +638,7 @@ :hook ((prog-mode . flycheck-mode) (prog-mode . flyspell-prog-mode) (prog-mode . visual-line-mode) - (prog-mode . dwrz-hightlight-keywords)) + (prog-mode . (lambda () (dwrz-highlight-keywords)))) :ensure nil) (use-package rainbow-mode @@ -676,7 +695,7 @@ (use-package sql :hook (sql-mode . sqlind-minor-mode) :ensure nil) ;; TODO: see if this can be replaced with sql-linter-program. -(use-package sql-indent :config (setq sqlind-basic-offset 4) :ensure t) +(use-package sql-indent :config (setq sqlind-basic-offset 4) :defer t :ensure t) (use-package subword :init (global-subword-mode t) :ensure nil) @@ -686,6 +705,21 @@ (use-package subr-x :init (defalias 'yes-or-no-p 'y-or-n-p) :ensure nil) +;; https://github.com/minad/tempel +;; (use-package tempel +;; :bind (("M-+" . tempel-complete) +;; ("M-*" . tempel-insert)) +;; :custom (tempel-trigger-prefix ".") +;; :init +;; (defun tempel-setup-capf () +;; (setq-local completion-at-point-functions +;; (cons #'tempel-expand +;; completion-at-point-functions))) +;; (add-hook 'conf-mode-hook 'tempel-setup-capf) +;; (add-hook 'prog-mode-hook 'tempel-setup-capf) +;; (add-hook 'text-mode-hook 'tempel-setup-capf) +;; :ensure t) + (use-package text-mode :hook ((text-mode . flyspell-mode) (text-mode . visual-line-mode)) @@ -724,7 +758,7 @@ ("\\.gohtml\\'" . web-mode)) :ensure t) -(use-package wgrep :ensure t) +(use-package wgrep :defer t :ensure t) (use-package window :config (setq split-height-threshold nil @@ -847,5 +881,3 @@ (global-set-key (kbd "C-x 9") 'dwrz-split-window-two-thirds) (global-set-key (kbd "C-x C-b") 'ibuffer) (global-set-key (kbd "C-x t") 'dwrz-shell-in-current-directory) -(global-set-key [(meta down)] 'dwrz-transpose-line-down) -(global-set-key [(meta up)] 'dwrz-transpose-line-up)