feat: Add LLM integration and improve Emacs configuration

- Add gptel and gptel-magit packages for AI-powered Git commits and
- chat Add org-roam and org-roam-ui for better note-taking and
- knowledge management Add benchmark-init to measure startup
- performance Add winum for window navigation with keybindings Add
- vterm for better terminal emulation Configure exec-path-from-shell
- to inherit shell environment Add org-roam.db to gitignore Set
- use-short-answers for yes/no prompts Add org-todo-list keybinding
- and update magit binding Configure org-agenda-files to include org
- directory Remove commented eat package configuration
This commit is contained in:
Zelong Kuang
2025-12-14 06:09:17 +11:00
parent f38e5f3598
commit 0afab4e64e
8 changed files with 79 additions and 3 deletions

View File

@@ -10,12 +10,18 @@
(setq make-backup-files nil)
(setq custom-file (expand-file-name "~/.emacs.d/custom.el"))
(load custom-file 'no-error 'no-message)
(setq use-short-answers t)
(global-set-key (kbd "s-a") 'mark-whole-buffer) ;;对应Windows上面的Ctrl-a 全选
(global-set-key (kbd "s-c") 'kill-ring-save) ;;对应Windows上面的Ctrl-c 复制
(global-set-key (kbd "s-s") 'save-buffer) ;; 对应Windows上面的Ctrl-s 保存
(global-set-key (kbd "s-v") 'yank) ;对应Windows上面的Ctrl-v 粘贴
(global-set-key (kbd "s-z") 'undo) ;对应Windows上面的Ctrol-z 撤销
(global-set-key (kbd "s-x") 'sexp) ;对应Windows上面的Ctrol-x 剪切
(use-package exec-path-from-shell
:init
(exec-path-from-shell-initialize))
(global-set-key (kbd "C-x C-b") 'ibuffer)
(provide 'init-better-default)

View File

@@ -5,8 +5,9 @@
(define-key orgmode-map (kbd "a") #'org-agenda)
(define-key orgmode-map (kbd "n") #'org-capture)
(define-key orgmode-map (kbd "t") #'org-todo-list)
(global-set-key (kbd "C-c g") #'magit-status)
(global-set-key (kbd "C-\\") #'vterm)
(provide 'init-bindings)

View File

@@ -1,5 +1,20 @@
;; -*- lexical-binding: t -*-
(use-package magit)
(use-package magit
:bind ("C-c g" . magit-status)
:config
(setq magit-show-long-lines-warning nil))
;; (use-package eat
;; :ensure `(eat :repo "https://codeberg.org/akib/emacs-eat"
;; :files ("*.el" ("term" "term/*.el") "*.texi"
;; "*.ti" ("terminfo/e" "terminfo/e/*")
;; ("terminfo/65" "terminfo/65/*")
;; ("integration" "integration/*")
;; (:exclude ".dir-locals.el" "*-tests.el")))
;; :config
;; )
(use-package vterm)
(provide 'init-coding)

View File

@@ -5,5 +5,11 @@
(require 'smartparens-config)
(smartparens-global-mode))
(use-package winum
:init
(winum-mode)
:config
(winum-set-keymap-prefix (kbd "C-c w")) )
(provide 'init-edit)

16
lisp/init-llm.el Normal file
View File

@@ -0,0 +1,16 @@
;;; -*- lexical-binding: t; -*-
(use-package gptel
:defer t
:bind (("C-c l s" . gptel-send)
("C-c l m" . gptel-menu))
:config
(setq gptel-model 'claude-sonnet-4.5)
(setq gptel-backend (gptel-make-gh-copilot "Copilot"))
(setq gptel-display-buffer-action nil) ; if user changes this, popup manager will bow out
)
(use-package gptel-magit
:hook (magit-mode . gptel-magit-install))
(provide 'init-llm)

View File

@@ -14,7 +14,9 @@
;; (org-capture-init)
(add-to-list 'org-modules 'org-habit)
(setq org-directory "~/org/")
(add-to-list 'org-agenda-files "~/org")
)
(use-package org-modern
:config
(setq org-modern-table nil))
@@ -51,4 +53,24 @@
;; More immediate live-previews -- the default delay is 1 second
(setq org-latex-preview-mode-update-delay 0.25))
(use-package org-roam
:ensure t
:custom
(org-roam-directory (file-truename "~/org/roam"))
:bind (("C-c n l" . org-roam-buffer-toggle)
("C-c n f" . org-roam-node-find)
("C-c n g" . org-roam-graph)
("C-c n i" . org-roam-node-insert)
("C-c n c" . org-roam-capture)
;; Dailies
("C-c n j" . org-roam-dailies-capture-today))
:config
;; If you're using a vertical completion framework, you might want a more informative completion interface
(setq org-roam-node-display-template (concat "${title:*} " (propertize "${tags:10}" 'face 'org-tag)))
(org-roam-db-autosync-mode)
;; If using org-roam-protocol
(require 'org-roam-protocol))
(use-package org-roam-ui)
(provide 'init-org)