Integrate LLM for enhancement
1. Integrate gptel for general communications 2. Integrate aider.el for coding assistant 3. Adopt deepseek as the backend
This commit is contained in:
parent
8012a221c2
commit
8321dbe43b
1
.gitignore
vendored
1
.gitignore
vendored
@ -53,3 +53,4 @@ projects
|
|||||||
eln-cache/
|
eln-cache/
|
||||||
.cache/
|
.cache/
|
||||||
history
|
history
|
||||||
|
.aider*
|
||||||
|
6
.gitmodules
vendored
6
.gitmodules
vendored
@ -13,3 +13,9 @@
|
|||||||
[submodule "site-lisp/vertico-posframe"]
|
[submodule "site-lisp/vertico-posframe"]
|
||||||
path = site-lisp/vertico-posframe
|
path = site-lisp/vertico-posframe
|
||||||
url = https://github.com/tumashu/vertico-posframe.git
|
url = https://github.com/tumashu/vertico-posframe.git
|
||||||
|
[submodule "site-lisp/aider"]
|
||||||
|
path = site-lisp/aider
|
||||||
|
url = https://github.com/tninja/aider.el
|
||||||
|
[submodule "site-lisp/beancount-mode"]
|
||||||
|
path = site-lisp/beancount-mode
|
||||||
|
url = https://github.com/beancount/beancount-mode.git
|
||||||
|
1
init.el
1
init.el
@ -17,6 +17,7 @@
|
|||||||
(require 'init-treemacs)
|
(require 'init-treemacs)
|
||||||
(require 'init-save)
|
(require 'init-save)
|
||||||
(require 'init-window)
|
(require 'init-window)
|
||||||
|
(require 'init-ai)
|
||||||
|
|
||||||
;; Edit
|
;; Edit
|
||||||
(require 'init-completion)
|
(require 'init-completion)
|
||||||
|
@ -33,5 +33,8 @@ npm install -g pyright
|
|||||||
pip3 install ruff-lsp --break-system-packages
|
pip3 install ruff-lsp --break-system-packages
|
||||||
brew install texlab
|
brew install texlab
|
||||||
|
|
||||||
|
# aider
|
||||||
|
brew install aider
|
||||||
|
|
||||||
# fetch submodules
|
# fetch submodules
|
||||||
git submodule update --init
|
git submodule update --init
|
||||||
|
@ -36,5 +36,10 @@ cargo build --release
|
|||||||
# vterm
|
# vterm
|
||||||
sudo apt install cmake libtool-bin libvterm-dev
|
sudo apt install cmake libtool-bin libvterm-dev
|
||||||
|
|
||||||
|
# aider
|
||||||
|
export PATH="$PATH:$HOME/.local/bin"
|
||||||
|
python -m pip install aider-install --break-system-packages
|
||||||
|
aider-install
|
||||||
|
|
||||||
# fetch submodules
|
# fetch submodules
|
||||||
git submodule update --init
|
git submodule update --init
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
(defun deepseek-api-key-path ()
|
(defun deepseek-api-key-path ()
|
||||||
"Return the path to the DeepSeek API key file."
|
"Return the path to the DeepSeek API key file."
|
||||||
(expand-file-name "~/.config/llm/deepseek/api_key.txt"))
|
(expand-file-name "~/.dotfiles/llm/deepseek/api_key.txt"))
|
||||||
|
|
||||||
(defun read-llm-api-key (path)
|
(defun read-llm-api-key (path)
|
||||||
"Read and return the API key from the specified file path."
|
"Read and return the API key from the specified file path."
|
||||||
@ -18,14 +18,14 @@
|
|||||||
(use-package gptel
|
(use-package gptel
|
||||||
:ensure t
|
:ensure t
|
||||||
:config
|
:config
|
||||||
(setq gptel-model "deepseek-chat")
|
(setq gptel-model 'deepseek-chat)
|
||||||
(setq gptel-default-mode 'org-mode)
|
(setq gptel-default-mode 'org-mode)
|
||||||
(gptel-set-openai "DeepSeek"
|
(setq gptel-backend (gptel-make-openai "DeepSeek"
|
||||||
:host "api.deepseek.com"
|
:host "api.deepseek.com"
|
||||||
:endpoint "/chat/completions"
|
:endpoint "/chat/completions"
|
||||||
:stream t
|
:stream t
|
||||||
:key (read-llm-api-key (deepseek-api-key-path))
|
:key (read-llm-api-key (deepseek-api-key-path))
|
||||||
:models '("deepseek-chat" "deepseek-coder")))
|
:models '("deepseek-chat" "deepseek-coder"))))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; aider.el
|
;; aider.el
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(add-to-list 'load-path "~/.emacs.d/site-lisp/beancount/")
|
(add-to-list 'load-path "~/.emacs.d/site-lisp/beancount-mode/")
|
||||||
(require 'beancount)
|
(require 'beancount)
|
||||||
(add-to-list 'auto-mode-alist '("\\.bean\\'" . beancount-mode))
|
(add-to-list 'auto-mode-alist '("\\.bean\\'" . beancount-mode))
|
||||||
(add-hook 'beancount-mode-hook
|
(add-hook 'beancount-mode-hook
|
||||||
|
@ -24,9 +24,9 @@
|
|||||||
(setq dired-use-ls-dired t)
|
(setq dired-use-ls-dired t)
|
||||||
(setq dired-listing-switches "-al --group-directories-first")
|
(setq dired-listing-switches "-al --group-directories-first")
|
||||||
|
|
||||||
(use-package nerd-icons-dired
|
;; (use-package nerd-icons-dired
|
||||||
:hook
|
;; :hook
|
||||||
(dired-mode . nerd-icons-dired-mode))
|
;; (dired-mode . nerd-icons-dired-mode))
|
||||||
|
|
||||||
(provide 'init-dired)
|
(provide 'init-dired)
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
@ -3,6 +3,10 @@
|
|||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;; auto-revert
|
||||||
|
(global-auto-revert-mode 1)
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; Fluently Edit Large Files
|
;; Fluently Edit Large Files
|
||||||
;; https://emacs-china.org/t/topic/25811/6
|
;; https://emacs-china.org/t/topic/25811/6
|
||||||
|
@ -17,6 +17,8 @@
|
|||||||
("\\*corfu.*\\*" :regexp t :ignore t)
|
("\\*corfu.*\\*" :regexp t :ignore t)
|
||||||
("*eshell*" :select t :size 0.4 :align t :popup t)
|
("*eshell*" :select t :size 0.4 :align t :popup t)
|
||||||
("*vterm*" :select t :size 0.4 :align t :popup t)
|
("*vterm*" :select t :size 0.4 :align t :popup t)
|
||||||
|
("*DeepSeek*" :select t :size 0.4 :align t :popup t)
|
||||||
|
(comint-mode :select t :size 0.4 :align t :popup t)
|
||||||
(helpful-mode :select t :size 0.6 :align right :popup t)
|
(helpful-mode :select t :size 0.6 :align right :popup t)
|
||||||
("*Messages*" :select t :size 0.4 :align t :popup t)
|
("*Messages*" :select t :size 0.4 :align t :popup t)
|
||||||
("*Calendar*" :select t :size 0.3 :align t :popup t)
|
("*Calendar*" :select t :size 0.3 :align t :popup t)
|
||||||
@ -34,15 +36,18 @@
|
|||||||
)
|
)
|
||||||
:init
|
:init
|
||||||
(setq popper-reference-buffers
|
(setq popper-reference-buffers
|
||||||
'("\\*Messages\\*"
|
'(
|
||||||
|
"\\*DeepSeek\\*"
|
||||||
|
comint-mode
|
||||||
|
"\\*Messages\\*"
|
||||||
"\\*Async Shell Command\\*"
|
"\\*Async Shell Command\\*"
|
||||||
help-mode
|
help-mode
|
||||||
helpful-mode
|
helpful-mode
|
||||||
occur-mode
|
occur-mode
|
||||||
pass-view-mode
|
pass-view-mode
|
||||||
"^\\*eshell.*\\*$" eshell-mode ;; eshell as a popup
|
"^\\*eshell.*\\*$" eshell-mode
|
||||||
"^\\*shell.*\\*$" shell-mode ;; shell as a popup
|
"^\\*shell.*\\*$" shell-mode
|
||||||
"^\\*vterm*\\*$" vterm-mode ;; vterm as a popup
|
"^\\*vterm*\\*$" vterm-mode
|
||||||
("\\*corfu\\*" . hide)
|
("\\*corfu\\*" . hide)
|
||||||
(compilation-mode . hide)
|
(compilation-mode . hide)
|
||||||
;; derived from `fundamental-mode' and fewer than 10 lines will be considered a popup
|
;; derived from `fundamental-mode' and fewer than 10 lines will be considered a popup
|
||||||
|
1
site-lisp/aider
Submodule
1
site-lisp/aider
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit a7f21534522a725259cf2efd46837d7bd88ec231
|
1
site-lisp/auto-save
Submodule
1
site-lisp/auto-save
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 0fb3c0f38191c0e74f00bae6adaa342de3750e83
|
1
site-lisp/beancount-mode
Submodule
1
site-lisp/beancount-mode
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 452621fa1f918d8a105e09d3bd82b2deb45b7146
|
1
site-lisp/lsp-bridge
Submodule
1
site-lisp/lsp-bridge
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 402e65f372bb4268c0cd0514a12f0b0e9649c4af
|
1
site-lisp/one-key
Submodule
1
site-lisp/one-key
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit b268d8e8591f273a2b2b52da10760b610c8a0bce
|
Loading…
Reference in New Issue
Block a user