update add claude code

This commit is contained in:
2025-10-19 21:57:36 +08:00
parent 788b862e5b
commit 48f26adf81
3 changed files with 64 additions and 1 deletions
+55
View File
@@ -12,3 +12,58 @@
anthropic/claude-sonnet-4
anthropic/claude-sonnet-4.5
)))
;;; Claude Code Configuration
(use-package! claude-code
:config
;; Use vterm backend
(setq claude-code-terminal-backend 'vterm)
;; Enable global mode
(claude-code-mode 1)
;; Set key bindings prefix
(map! :leader
(:prefix ("C" . "claude-code")
:desc "Start Claude" "c" #'claude-code
:desc "Start in directory" "d" #'claude-code-start-in-directory
:desc "Continue conversation" "C" #'claude-code-continue
:desc "Resume session" "R" #'claude-code-resume
:desc "New instance" "i" #'claude-code-new-instance
:desc "Kill Claude" "k" #'claude-code-kill
:desc "Kill all instances" "K" #'claude-code-kill-all
:desc "Send command" "s" #'claude-code-send-command
:desc "Send command with context" "x" #'claude-code-send-command-with-context
:desc "Send region/buffer" "r" #'claude-code-send-region
:desc "Send buffer file" "o" #'claude-code-send-buffer-file
:desc "Fix error at point" "e" #'claude-code-fix-error-at-point
:desc "Toggle window" "t" #'claude-code-toggle
:desc "Switch to buffer" "b" #'claude-code-switch-to-buffer
:desc "Select buffer" "B" #'claude-code-select-buffer
:desc "Toggle read-only" "z" #'claude-code-toggle-read-only-mode
:desc "Cycle mode" "M" #'claude-code-cycle-mode
:desc "Transient menu" "m" #'claude-code-transient
:desc "Slash commands" "/" #'claude-code-slash-commands
:desc "Fork conversation" "f" #'claude-code-fork
:desc "Send return" "y" #'claude-code-send-return
:desc "Send escape" "n" #'claude-code-send-escape
:desc "Send 1" "1" #'claude-code-send-1
:desc "Send 2" "2" #'claude-code-send-2
:desc "Send 3" "3" #'claude-code-send-3))
;; Optional: Configure window display (side window on right)
(add-to-list 'display-buffer-alist
'("^\\*claude"
(display-buffer-in-side-window)
(side . right)
(window-width . 90)))
;; Optional: Enable auto-revert for files modified by Claude
(global-auto-revert-mode 1)
;; Optional: Increase vterm scrollback for long conversations
(add-hook 'claude-code-start-hook
(lambda ()
(when (eq claude-code-terminal-backend 'vterm)
(setq-local vterm-max-scrollback 100000)))))
+1 -1
View File
@@ -78,7 +78,7 @@
eshell ; the elisp shell that works everywhere
;;shell ; simple shell REPL for Emacs
;;term ; basic terminal emulator for Emacs
;;vterm ; the best terminal emulation in Emacs
vterm ; the best terminal emulation in Emacs
:checkers
syntax ; tasing you for every semicolon you forget
+8
View File
@@ -29,3 +29,11 @@
(package! tree-sitter-langs)
(package! ob-mermaid)
;; Claude Code integration
(package! inheritenv
:recipe (:host github :repo "purcell/inheritenv"))
(package! claude-code
:recipe (:host github :repo "stevemolitor/claude-code.el" :branch "main" :depth 1
:files ("*.el" (:exclude "images/*"))))