.emacs.d

the most bloated Emacs config on this planet
git clone https://git.trogloxene.org/.emacs.d.git
Log | Files | Refs

commit bcd9f322d30b7e5042c7e33923c8e06e6fea1c42
parent 94715328e2679ac1fd97f3af008ed12ca81e30fc
Author: andsy10 <andsy1016@gmail.com>
Date:   Sat,  1 Aug 2026 19:46:58 +0800

Replace opencode with pi-coding-agent

Diffstat:
Mlisp/init-gptel.el | 37++-----------------------------------
Mlisp/init-kbd-func.el | 6+++---
Mlisp/init-kbd.el | 27+++++++--------------------
Mlisp/init-package.el | 2+-
Mlisp/init-prog.el | 3++-
Mlisp/init-window.el | 1+
Mlisp/my-dark-theme.el | 33+++++++++++++++++++++++++--------
Mlisp/my-light-theme.el | 32++++++++++++++++++++++++--------
8 files changed, 65 insertions(+), 76 deletions(-)

diff --git a/lisp/init-gptel.el b/lisp/init-gptel.el @@ -146,41 +146,8 @@ explanations, no quotes, no punctuation, no file extension." (setq gptel-magit-model 'kimi-for-coding gptel-magit-backend (gptel-get-backend "gptel-Kimi-Code-magit")))) -;; opencode -(use-package plz - :straight - (plz :type git - :host github - :repo "alphapapa/plz.el" - :ref "v0.9.1")) - -(use-package plz-media-type - :straight - (plz-media-type :type git - :host github - :repo "r0man/plz-media-type" - :ref "v0.2.4")) - -(use-package plz-event-source - :straight - (plz-event-source :type git - :host github - :repo "r0man/plz-event-source" - :ref "v0.1.3")) - -(use-package opencode - :straight - (opencode :type git - :host codeberg - :repo "sczi/opencode.el") - :hook - (opencode-session-control-mode . disable-truncate-lines)) - -(use-package eval-elisp-mcp - :straight - (eval-elisp-mcp :type git - :host codeberg - :repo "sczi/eval-elisp-mcp")) +;; pi +(use-package pi-coding-agent) (provide 'init-gptel) ;;; init-gptel.el ends here diff --git a/lisp/init-kbd-func.el b/lisp/init-kbd-func.el @@ -254,11 +254,11 @@ argument)." (let ((current-prefix-arg '-)) (call-interactively 'gptel-agent))) -(defun my-opencode () - "Run `opencode' in project root." +(defun my-pi-coding-agent () + "Run `pi-coding-agent' in project root." (interactive) (let ((default-directory (project-root (project-current t)))) - (opencode))) + (pi-coding-agent))) (defun my-consult-git-grep-project () "Run `consult-git-grep' in current project's root." diff --git a/lisp/init-kbd.el b/lisp/init-kbd.el @@ -24,29 +24,16 @@ "s" 'gptel-send "a" 'gptel-agent "t" 'gptel-tools - "o" 'opencode - "p" 'opencode-select-project - "l" 'opencode-select-session - "n" 'opencode-new-session) + "p" 'pi-coding-agent) (general-def gptel-mode-map "C-c C-s" 'my-gptel-save-session "C-c C-k" 'gptel-abort) -;; opencode -(general-def opencode-session-mode-map - "C-c C-p" 'comint-previous-prompt - "C-c M-p" 'opencode-respond-permission - "C-c x" nil - "C-c C-k" 'opencode-abort-session - "C-c C-c" 'nil - "C-c n" 'nil - "C-c N" 'opencode-new-session) - -(general-def opencode-session-control-mode-map - "n" 'next-line - "p" 'previous-line - "N" 'opencode-new-session) +;; pi +(general-def (pi-coding-agent-input-mode-map + pi-coding-agent-chat-mode-map) + "C-c C-q" 'pi-coding-agent-quit) ;; u for ui (general-def @@ -89,8 +76,8 @@ "R" 'project-query-replace-regexp "v" 'magit-project-status "V" 'project-vc-dir - "a" 'my-opencode - "i" 'project-ibuffer) + "i" 'project-ibuffer + "a" 'my-pi-coding-agent) ;; v for version control (general-def diff --git a/lisp/init-package.el b/lisp/init-package.el @@ -148,7 +148,7 @@ _a_ : all dwim (consult-grep "Grep" ?r) (consult-project-buffer "Buffers" ?b) (project-ibuffer "Ibuffer" ?i) - (opencode "OpenCode" ?a)))))) + (pi-coding-agent "Pi" ?a)))))) (use-package project-ibuffer :straight diff --git a/lisp/init-prog.el b/lisp/init-prog.el @@ -35,7 +35,8 @@ (after-init . global-treesit-auto-mode) :config (setq treesit-auto-install 'prompt) - (setq treesit-font-lock-level 4)) + (setq treesit-font-lock-level 4) + (delete 'markdown treesit-auto-langs)) ;; scheme (use-package geiser diff --git a/lisp/init-window.el b/lisp/init-window.el @@ -44,6 +44,7 @@ "\\*gptel-Kimi-Code\\*" "\\*gptel-agent:.*\\*" "^\\*OpenCode Sessions" + "^\\*pi-coding-agent-input" "^\\*sly" "^magit" "\\*discomfort\\*" diff --git a/lisp/my-dark-theme.el b/lisp/my-dark-theme.el @@ -31,14 +31,23 @@ `(mode-line-inactive ((,class (:foreground ,base01 :background ,base03)))) `(display-time-date-and-time ((,class (:foreground ,base1 :bold t)))) - `(org-level-1 ((,class (:foreground ,orange :height 1.0 :weight normal)))) - `(org-level-2 ((,class (:foreground ,blue :height 1.0 :weight normal)))) - `(org-level-3 ((,class (:foreground ,green :height 1.0 :weight normal)))) - `(org-level-4 ((,class (:foreground ,yellow :height 1.0 :weight normal)))) - `(org-level-5 ((,class (:foreground ,cyan :height 1.0 :weight normal)))) - `(org-level-6 ((,class (:foreground ,green :height 1.0 :weight normal)))) - `(org-level-7 ((,class (:foreground ,orange :height 1.0 :weight normal)))) - `(org-level-8 ((,class (:foreground ,blue :height 1.0 :weight normal)))) + `(outline-1 ((,class (:foreground ,orange :height 1.0 :weight normal)))) + `(outline-2 ((,class (:foreground ,blue :height 1.0 :weight normal)))) + `(outline-3 ((,class (:foreground ,green :height 1.0 :weight normal)))) + `(outline-4 ((,class (:foreground ,yellow :height 1.0 :weight normal)))) + `(outline-5 ((,class (:foreground ,cyan :height 1.0 :weight normal)))) + `(outline-6 ((,class (:foreground ,green :height 1.0 :weight normal)))) + `(outline-7 ((,class (:foreground ,orange :height 1.0 :weight normal)))) + `(outline-8 ((,class (:foreground ,blue :height 1.0 :weight normal)))) + + `(org-level-1 ((,class (:inherit outline-1)))) + `(org-level-2 ((,class (:inherit outline-2)))) + `(org-level-3 ((,class (:inherit outline-3)))) + `(org-level-4 ((,class (:inherit outline-4)))) + `(org-level-5 ((,class (:inherit outline-5)))) + `(org-level-6 ((,class (:inherit outline-6)))) + `(org-level-7 ((,class (:inherit outline-7)))) + `(org-level-8 ((,class (:inherit outline-8)))) `(org-document-title ((,class (:foreground ,base0 :height 1.0 :weight bold)))) `(org-done ((,class (:foreground ,green :weight bold)))) `(org-headline-done ((,class (:foreground ,green)))) @@ -65,6 +74,14 @@ `(markdown-code-face ((,class (:foreground ,base0)))) `(markdown-table-face ((,class (:foreground ,green)))) + `(md-ts-heading-1 ((,class (:inherit outline-1)))) + `(md-ts-heading-2 ((,class (:inherit outline-2)))) + `(md-ts-heading-3 ((,class (:inherit outline-3)))) + `(md-ts-heading-4 ((,class (:inherit outline-4)))) + `(md-ts-heading-5 ((,class (:inherit outline-5)))) + `(md-ts-heading-6 ((,class (:inherit outline-6)))) + `(md-ts-code ((,class (:foreground ,base01)))) + `(dashboard-footer-face ((,class (:foreground ,blue)))) `(dashboard-text-banner ((,class (:foreground ,green)))) `(dashboard-heading ((,class (:foreground ,green :weight bold)))) diff --git a/lisp/my-light-theme.el b/lisp/my-light-theme.el @@ -31,14 +31,23 @@ `(mode-line-inactive ((,class (:foreground ,base01 :background ,base03)))) `(display-time-date-and-time ((,class (:foreground ,base1 :bold t)))) - `(org-level-1 ((,class (:foreground ,orange :height 1.0 :weight normal)))) - `(org-level-2 ((,class (:foreground ,blue :height 1.0 :weight normal)))) - `(org-level-3 ((,class (:foreground ,green :height 1.0 :weight normal)))) - `(org-level-4 ((,class (:foreground ,yellow :height 1.0 :weight normal)))) - `(org-level-5 ((,class (:foreground ,cyan :height 1.0 :weight normal)))) - `(org-level-6 ((,class (:foreground ,green :height 1.0 :weight normal)))) - `(org-level-7 ((,class (:foreground ,orange :height 1.0 :weight normal)))) - `(org-level-8 ((,class (:foreground ,blue :height 1.0 :weight normal)))) + `(outline-1 ((,class (:foreground ,orange :height 1.0 :weight normal)))) + `(outline-2 ((,class (:foreground ,blue :height 1.0 :weight normal)))) + `(outline-3 ((,class (:foreground ,green :height 1.0 :weight normal)))) + `(outline-4 ((,class (:foreground ,yellow :height 1.0 :weight normal)))) + `(outline-5 ((,class (:foreground ,cyan :height 1.0 :weight normal)))) + `(outline-6 ((,class (:foreground ,green :height 1.0 :weight normal)))) + `(outline-7 ((,class (:foreground ,orange :height 1.0 :weight normal)))) + `(outline-8 ((,class (:foreground ,blue :height 1.0 :weight normal)))) + + `(org-level-1 ((,class (:inherit outline-1)))) + `(org-level-2 ((,class (:inherit outline-2)))) + `(org-level-3 ((,class (:inherit outline-3)))) + `(org-level-4 ((,class (:inherit outline-4)))) + `(org-level-5 ((,class (:inherit outline-5)))) + `(org-level-6 ((,class (:inherit outline-6)))) + `(org-level-7 ((,class (:inherit outline-7)))) + `(org-level-8 ((,class (:inherit outline-8)))) `(org-document-title ((,class (:foreground ,base0 :height 1.0 :weight bold)))) `(org-done ((,class (:foreground ,green :weight bold)))) `(org-headline-done ((,class (:foreground ,green)))) @@ -65,6 +74,13 @@ `(markdown-code-face ((,class (:foreground ,base0)))) `(markdown-table-face ((,class (:foreground ,green)))) + `(md-ts-heading-1 ((,class (:inherit outline-1)))) + `(md-ts-heading-2 ((,class (:inherit outline-2)))) + `(md-ts-heading-3 ((,class (:inherit outline-3)))) + `(md-ts-heading-4 ((,class (:inherit outline-4)))) + `(md-ts-heading-5 ((,class (:inherit outline-5)))) + `(md-ts-heading-6 ((,class (:inherit outline-6)))) + `(md-ts-code ((,class (:foreground ,base01)))) `(dashboard-footer-face ((,class (:foreground ,blue)))) `(dashboard-text-banner ((,class (:foreground ,green)))) `(dashboard-heading ((,class (:foreground ,green :weight bold))))