summaryrefslogtreecommitdiff
path: root/init.el
diff options
context:
space:
mode:
authorbenj <benj@rse8.com>2026-03-02 23:57:41 +0800
committerbenj <benj@rse8.com>2026-03-02 23:57:41 +0800
commit681e5d3e6f77da4d28b56a1d55374c7ef3cbb246 (patch)
tree4f10aa9ad7f9f025a50872475c412e770b1bcf38 /init.el
parent1d4d38e0c70097cf3f5ce6b8a924b8e981577182 (diff)
downloademacs-681e5d3e6f77da4d28b56a1d55374c7ef3cbb246.tar
emacs-681e5d3e6f77da4d28b56a1d55374c7ef3cbb246.tar.gz
emacs-681e5d3e6f77da4d28b56a1d55374c7ef3cbb246.tar.bz2
emacs-681e5d3e6f77da4d28b56a1d55374c7ef3cbb246.tar.lz
emacs-681e5d3e6f77da4d28b56a1d55374c7ef3cbb246.tar.xz
emacs-681e5d3e6f77da4d28b56a1d55374c7ef3cbb246.tar.zst
emacs-681e5d3e6f77da4d28b56a1d55374c7ef3cbb246.zip
some claude-code, mu4e, and org journal updates
Diffstat (limited to '')
-rw-r--r--init.el130
1 files changed, 116 insertions, 14 deletions
diff --git a/init.el b/init.el
index 493f71a..35fe957 100644
--- a/init.el
+++ b/init.el
@@ -129,6 +129,12 @@
(use-package cargo-mode
:ensure t)
+(use-package claude-code
+ :ensure t
+ :after vterm
+ :config
+ )
+
(use-package cmake-mode
:ensure t
:mode "\\CMakeLists\\.txt\\'")
@@ -339,6 +345,73 @@
("p" . 'mc/mark-previous-like-this)
("r r" . 'mc/mark-all-in-region-regexp)))
+(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")
+ mu4e-drafts-folder (concat "/" first-account "/Drafts")
+ mu4e-trash-folder (concat "/" first-account "/Trash")
+ mu4e-refile-folder (concat "/" first-account "/Archive"))))
+ :config
+ (setq mu4e-maildir "~/.mail"
+ mu4e-get-mail-command "mbsync -a"
+ mu4e-update-interval 300
+ mu4e-change-filenames-when-moving t
+ mu4e-attachment-dir "~/Downloads/"
+ mu4e-context-policy 'pick-first
+ mu4e-compose-context-policy 'ask-if-none)
+
+ (setq message-send-mail-function 'message-send-mail-with-sendmail
+ sendmail-program "/usr/bin/msmtp"
+ message-sendmail-extra-arguments '("--read-envelope-from")
+ message-sendmail-f-is-evil t)
+
+ (defvar my/mu4e-account-maildirs
+ '((mu4e-drafts-folder . "Drafts")
+ (mu4e-sent-folder . "Sent")
+ (mu4e-refile-folder . "Archive")
+ (mu4e-trash-folder . "Trash"))
+ "Common subfolder names shared across all accounts.")
+
+ (defvar my/mu4e-account-shortcuts
+ '(("Inbox" . ?i)
+ ("Archive" . ?a)
+ ("Sent" . ?s)
+ ("Trash" . ?t))
+ "Common shortcut folders shared across all accounts.")
+
+ (defun my/mu4e-discover-accounts ()
+ "Scan ~/.mail for directories and generate mu4e contexts."
+ (let ((accounts (directory-files mu4e-maildir nil "^[^.]")))
+ (mapcar
+ (lambda (account)
+ (make-mu4e-context
+ :name account
+ :match-func
+ (lambda (msg)
+ (when msg
+ (string-prefix-p (concat "/" account)
+ (mu4e-message-field msg :maildir))))
+ :vars
+ (append
+ `((user-mail-address . ,account)
+ (user-full-name . ,(user-full-name)))
+ (mapcar (lambda (pair)
+ (cons (car pair)
+ (concat "/" account "/" (cdr pair))))
+ my/mu4e-account-maildirs)
+ `((mu4e-maildir-shortcuts
+ . ,(mapcar (lambda (pair)
+ (cons (concat "/" account "/" (car pair))
+ (cdr pair)))
+ my/mu4e-account-shortcuts))))))
+ accounts)))
+
+ (setq mu4e-contexts (my/mu4e-discover-accounts)))
+
(use-package nerd-icons
:ensure t
:after marginalia
@@ -393,7 +466,7 @@
(setq org-journal-dir org-dir-journal)
(setq org-journal-file-type 'monthly)
(setq org-journal-file-format "%Y-%m.org")
- (setq org-journal-enable-agenda-integration t))
+ (setq org-journal-enable-agenda-integration nil))
(use-package org-mode
:after (:all org-ai org-journal ob-restclient)
@@ -401,18 +474,23 @@
:bind (:prefix-map org-commands
:prefix-docstring "Org mode quick commands"
:prefix "C-c o"
- ("j o" . 'org-journal-open-current-journal-file)
- ("j n" . 'org-journal-new-entry)
- ("j s" . 'org-journal-new-scheduled-entry))
+ ("j o" . org-journal-open-current-journal-file)
+ ("j n" . org-journal-new-entry)
+ ("j s" . org-journal-new-scheduled-entry)
+ ("c i" . org-capture)
+ ("a" . org-agenda))
:hook ((org-mode . hl-todo-mode)
(org-mode . olivetti-mode)
(org-mode . org-ai-mode)
(org-mode . org-indent-mode))
+
:init
+ (setq org-gtd-dir (expand-file-name "gtd/" org-dir))
+
(org-babel-do-load-languages
'org-babel-load-languages
- '((emacs-lisp . t )
+ '((emacs-lisp . t)
(python . t)
(restclient . t)
(haskell . t)
@@ -421,14 +499,29 @@
(setq org-ai-image-directory (expand-file-name "org-ai-images/" org-dir))
- :custom-face
- (org-level-1 ((t (:family "Roboto" :height 120))))
- (org-level-2 ((t (:family "Roboto" :height 110))))
- (org-level-3 ((t (:family "Roboto" :height 100))))
- (org-document-title ((t (:family "Roboto Slab" :height 220 :weight medium))))
- (org-document-info ((t (:family "Roboto Slab" :height 110 :weight medium))))
-
:custom
+ ;; GTD files
+ (org-default-notes-file (expand-file-name "gtd/inbox.org" org-dir))
+ (org-agenda-files (list (expand-file-name "gtd/inbox.org" org-dir)
+ (expand-file-name "gtd/active.org" org-dir)))
+
+ ;; Capture templates
+ (org-capture-templates
+ `(("i" "Inbox" entry (file+headline ,(expand-file-name "gtd/inbox.org" org-dir) "Inbox")
+ "* TODO %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n"
+ :empty-lines 1)))
+
+ ;; Refile targets
+ (org-refile-targets `((,(expand-file-name "gtd/active.org" org-dir) :maxlevel . 2)))
+ (org-refile-use-outline-path 'file)
+ (org-outline-path-complete-in-steps nil)
+ (org-refile-allow-creating-parent-nodes 'confirm)
+
+ ;; Archive location (year-based)
+ (org-archive-location (concat (expand-file-name "gtd/archive/" org-dir)
+ (format-time-string "%Y") ".org::"))
+
+ ;; Display settings
(org-auto-align-tags t)
(org-hidden-keywords '(title author date startup))
(org-startup-folded nil)
@@ -437,10 +530,19 @@
(org-num-face nil)
(org-level-color-stars-only nil)
+ ;; Todo keywords
(org-todo-keywords
- `((sequence "BACKLOG(b)" "BLOCKED(l)" "TODO(t)" "IN_PROGRESS(i)" "|" "DONE(d)" "CANCELLED(c)")))
+ '((sequence "BACKLOG(b)" "BLOCKED(l)" "TODO(t)" "IN_PROGRESS(i)" "|" "DONE(d)" "CANCELLED(c)")))
- (org-confirm-babel-evaluate nil))
+ ;; Babel
+ (org-confirm-babel-evaluate nil)
+
+ :custom-face
+ (org-level-1 ((t (:family "Roboto" :height 120))))
+ (org-level-2 ((t (:family "Roboto" :height 110))))
+ (org-level-3 ((t (:family "Roboto" :height 100))))
+ (org-document-title ((t (:family "Roboto Slab" :height 220 :weight medium))))
+ (org-document-info ((t (:family "Roboto Slab" :height 110 :weight medium)))))
(use-package org-superstar
:ensure t