From 78e9725683eb32238d3051c42f58d76c1795abfe Mon Sep 17 00:00:00 2001 From: Zelong Kuang Date: Mon, 17 Nov 2025 01:34:12 +1100 Subject: [PATCH] Update --- config.el | 25 +++++++------------------ config.org | 27 +++++++++++++++++++-------- init.el | 2 +- packages.el | 3 +-- 4 files changed, 28 insertions(+), 29 deletions(-) diff --git a/config.el b/config.el index 1307bf4..bbe4c91 100644 --- a/config.el +++ b/config.el @@ -1,5 +1,3 @@ -(setq-default tab-width 4) - (setq doom-font (font-spec :family "Maple Mono" :size 20)) (add-to-list 'default-frame-alist '(height . 53)) (add-to-list 'default-frame-alist '(width . 120)) @@ -17,23 +15,14 @@ (add-hook 'post-command-hook #'my-yas-try-expanding-auto-snippets) ) -;; accept completion from copilot and fallback to company -(use-package! copilot - :hook (prog-mode . copilot-mode) - :bind (:map copilot-completion-map - ("" . 'copilot-accept-completion) - ("TAB" . 'copilot-accept-completion) - ("C-TAB" . 'copilot-accept-completion-by-word) - ("C-" . 'copilot-accept-completion-by-word) - ("C-n" . 'copilot-next-completion) - ("C-p" . 'copilot-previous-completion)) - +(use-package! gptel :config - (add-to-list 'copilot-indentation-alist '(prog-mode 2)) - (add-to-list 'copilot-indentation-alist '(org-mode 2)) - (add-to-list 'copilot-indentation-alist '(text-mode 2)) - (add-to-list 'copilot-indentation-alist '(clojure-mode 2)) - (add-to-list 'copilot-indentation-alist '(emacs-lisp-mode 2))) + (setq! gptel-api-key "e994f45f9b46cc8608bd2e9cd508417255514e96913b1764aab612512aa66449") + (setq gptel-model 'gemini-2.5-pro) + (setq gptel-backend (gptel-make-gh-copilot "Copilot")) + (map! "M-s RET" #'gptel-send) + (map! "M-s m" #'gptel-menu) + ) (use-package! typst-ts-mode :init diff --git a/config.org b/config.org index 95b91e4..b697c37 100644 --- a/config.org +++ b/config.org @@ -1,9 +1,4 @@ * My doom config -** Some tweak -*** change indent size -#+begin_src emacs-lisp -(setq-default tab-width 4) -#+end_src ** Appearance settings #+begin_src emacs-lisp @@ -22,7 +17,8 @@ #+end_src ** Plugins *** Yasnippet -This enables the feature of auto-expanding snippets when matching the pattern +Thisenables the feature of auto-expanding snippets when matching the pattern + #+begin_src emacs-lisp (use-package! yasnippet :config @@ -56,13 +52,13 @@ Fix the issue that backspace doesn't work on mac #+end_src *** Copilot -#+begin_src emacs-lisp :tangle packages.el +#+begin_src emacs-lisp :tangle no (package! copilot :recipe (:host github :repo "copilot-emacs/copilot.el" :files ("*.el"))) #+end_src Configuration -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle no ;; accept completion from copilot and fallback to company (use-package! copilot :hook (prog-mode . copilot-mode) @@ -82,6 +78,21 @@ Configuration (add-to-list 'copilot-indentation-alist '(emacs-lisp-mode 2))) #+end_src +*** LLM (gptel) +#+begin_src emacs-lisp :tangle packages.el +(package! gptel :recipe (:nonrecursive t)) +#+end_src + +#+begin_src emacs-lisp +(use-package! gptel + :config + (setq! gptel-api-key "e994f45f9b46cc8608bd2e9cd508417255514e96913b1764aab612512aa66449") + (setq gptel-model 'gemini-2.5-pro) + (setq gptel-backend (gptel-make-gh-copilot "Copilot")) + (map! "M-s RET" #'gptel-send) + (map! "M-s m" #'gptel-menu) + ) +#+end_src ** Lang *** Typst **** Tree-sitter diff --git a/init.el b/init.el index acdd72f..3bcf1d1 100644 --- a/init.el +++ b/init.el @@ -34,7 +34,7 @@ ;;doom-quit ; DOOM quit-message prompts when you quit Emacs (emoji +unicode) ; 🙂 hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW - indent-guides ; highlighted indent columns + ;; indent-guides ; highlighted indent columns ligatures ; ligatures and symbols to make your code pretty again ;;minimap ; show a map of the code on the side modeline ; snazzy, Atom-inspired modeline, plus API diff --git a/packages.el b/packages.el index 941d353..0a2692c 100644 --- a/packages.el +++ b/packages.el @@ -1,7 +1,6 @@ (package! catppuccin-theme) -(package! copilot - :recipe (:host github :repo "copilot-emacs/copilot.el" :files ("*.el"))) +(package! gptel :recipe (:nonrecursive t)) (package! typst-ts-mode :recipe (:host codeberg :repo "meow_king/typst-ts-mode"))