summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbenj <benj@rse8.com>2026-03-09 21:31:13 +0800
committerbenj <benj@rse8.com>2026-03-09 21:31:13 +0800
commitb210f727622cb38287c7bc77b9a31cc8c95c43e3 (patch)
tree26c8cad9edb77759f04d068dc382dbff51cef9a5
parent681e5d3e6f77da4d28b56a1d55374c7ef3cbb246 (diff)
downloademacs-b210f727622cb38287c7bc77b9a31cc8c95c43e3.tar
emacs-b210f727622cb38287c7bc77b9a31cc8c95c43e3.tar.gz
emacs-b210f727622cb38287c7bc77b9a31cc8c95c43e3.tar.bz2
emacs-b210f727622cb38287c7bc77b9a31cc8c95c43e3.tar.lz
emacs-b210f727622cb38287c7bc77b9a31cc8c95c43e3.tar.xz
emacs-b210f727622cb38287c7bc77b9a31cc8c95c43e3.tar.zst
emacs-b210f727622cb38287c7bc77b9a31cc8c95c43e3.zip
add claude-code keybinding and email localhost redirect
Diffstat (limited to '')
-rw-r--r--init.el26
1 files changed, 18 insertions, 8 deletions
diff --git a/init.el b/init.el
index 35fe957..2cbb459 100644
--- a/init.el
+++ b/init.el
@@ -131,9 +131,7 @@
(use-package claude-code
:ensure t
- :after vterm
- :config
- )
+ :init)
(use-package cmake-mode
:ensure t
@@ -237,13 +235,15 @@
(use-package gptel
:ensure t
- :after (password-store aider)
+ :after (password-store aider claude-code)
:bind (:prefix-map ai-commands
:prefix-docstring "Emacs AI comamands"
:prefix "C-c a"
("a" . 'gptel)
+ ("c" . 'claude-code-run)
("i" . 'aider-transient-menu)
("s" . 'gptel-menu)
+ ("q" . 'gptel-abort)
("RET" . 'gptel-send))
:custom
(gptel-api-key (auth-source-pass-get 'secret "openai.com/api.openai.com/apikey"))
@@ -348,7 +348,6 @@
(use-package mu4e
:ensure nil
:init
- ;; Set global defaults dynamically before mu4e loads
(let ((first-account (car (directory-files "~/.mail" nil "^[^.]"))))
(when first-account
(setq mu4e-sent-folder (concat "/" first-account "/Sent")
@@ -369,6 +368,14 @@
message-sendmail-extra-arguments '("--read-envelope-from")
message-sendmail-f-is-evil t)
+ (defun my/route-localhost-mail ()
+ "Force msmtp to use smtp4dev if emailing a localhost address."
+ (let ((to-field (message-field-value "To")))
+ (when (and to-field (string-match-p "@localhost" to-field))
+ (setq-local message-sendmail-extra-arguments '("-a" "smtp4dev")))))
+
+ (add-hook 'message-send-hook 'my/route-localhost-mail)
+
(defvar my/mu4e-account-maildirs
'((mu4e-drafts-folder . "Drafts")
(mu4e-sent-folder . "Sent")
@@ -386,10 +393,10 @@
(defun my/mu4e-discover-accounts ()
"Scan ~/.mail for directories and generate mu4e contexts."
(let ((accounts (directory-files mu4e-maildir nil "^[^.]")))
- (mapcar
- (lambda (account)
+ (seq-map-indexed
+ (lambda (account idx)
(make-mu4e-context
- :name account
+ :name (format "%d-%s" (1+ idx) account)
:match-func
(lambda (msg)
(when msg
@@ -587,6 +594,9 @@
(use-package projectile-ripgrep
:ensure t)
+(use-package protobuf-mode
+ :ensure t)
+
(use-package pyvenv
:ensure t)