Compare commits
4 Commits
c021bc8452
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 49b64da74d | |||
| 0c061e37ab | |||
| 4be0e63fac | |||
| cb6d55b456 |
@@ -9,7 +9,7 @@
|
|||||||
:defer t
|
:defer t
|
||||||
:config
|
:config
|
||||||
;; Default backend: OpenRouter
|
;; Default backend: OpenRouter
|
||||||
(setq gptel-model 'google/gemini-2.5-flash
|
(setq gptel-model 'google/gemini-3.flash-preview
|
||||||
gptel-backend
|
gptel-backend
|
||||||
(gptel-make-openai "OpenRouter"
|
(gptel-make-openai "OpenRouter"
|
||||||
:host "openrouter.ai"
|
:host "openrouter.ai"
|
||||||
@@ -48,32 +48,32 @@
|
|||||||
(after! gptel
|
(after! gptel
|
||||||
;; Coding assistant preset
|
;; Coding assistant preset
|
||||||
(gptel-make-preset 'coder
|
(gptel-make-preset 'coder
|
||||||
:description "Expert coding assistant"
|
:description "Expert coding assistant"
|
||||||
:backend "OpenRouter"
|
:backend "OpenRouter"
|
||||||
:model 'anthropic/claude-sonnet-4.5
|
:model 'anthropic/claude-sonnet-4.5
|
||||||
:system "You are an expert coding assistant. Provide high-quality code solutions, refactorings, and explanations. Be concise but thorough. Include error handling and follow best practices.")
|
:system "You are an expert coding assistant. Provide high-quality code solutions, refactorings, and explanations. Be concise but thorough. Include error handling and follow best practices.")
|
||||||
|
|
||||||
;; Code explainer preset
|
;; Code explainer preset
|
||||||
(gptel-make-preset 'explain
|
(gptel-make-preset 'explain
|
||||||
:description "Explain code to beginners"
|
:description "Explain code to beginners"
|
||||||
:system "Explain this code to a novice programmer. Use simple language and break down complex concepts.")
|
:system "Explain this code to a novice programmer. Use simple language and break down complex concepts.")
|
||||||
|
|
||||||
;; Refactoring preset
|
;; Refactoring preset
|
||||||
(gptel-make-preset 'refactor
|
(gptel-make-preset 'refactor
|
||||||
:description "Code refactoring expert"
|
:description "Code refactoring expert"
|
||||||
:model 'anthropic/claude-sonnet-4.5
|
:model 'anthropic/claude-sonnet-4.5
|
||||||
:system "You are a code refactoring expert. Improve code quality, readability, and performance while maintaining functionality. Explain your changes.")
|
:system "You are a code refactoring expert. Improve code quality, readability, and performance while maintaining functionality. Explain your changes.")
|
||||||
|
|
||||||
;; Quick answers preset
|
;; Quick answers preset
|
||||||
(gptel-make-preset 'quick
|
(gptel-make-preset 'quick
|
||||||
:description "Quick, concise answers"
|
:description "Quick, concise answers"
|
||||||
:model 'google/gemini-2.5-flash
|
:model 'google/gemini-2.5-flash
|
||||||
:system "Provide quick, concise answers. Be direct and to the point.")
|
:system "Provide quick, concise answers. Be direct and to the point.")
|
||||||
|
|
||||||
;; Documentation writer preset
|
;; Documentation writer preset
|
||||||
(gptel-make-preset 'docs
|
(gptel-make-preset 'docs
|
||||||
:description "Documentation writer"
|
:description "Documentation writer"
|
||||||
:system "Write clear, comprehensive documentation. Include examples and explain edge cases."))
|
:system "Write clear, comprehensive documentation. Include examples and explain edge cases."))
|
||||||
|
|
||||||
;;; ============================================================================
|
;;; ============================================================================
|
||||||
;;; gptel-quick - Quick lookups and explanations
|
;;; gptel-quick - Quick lookups and explanations
|
||||||
@@ -161,9 +161,9 @@
|
|||||||
(when (use-region-p)
|
(when (use-region-p)
|
||||||
(let ((code (buffer-substring-no-properties (region-beginning) (region-end))))
|
(let ((code (buffer-substring-no-properties (region-beginning) (region-end))))
|
||||||
(gptel-request code
|
(gptel-request code
|
||||||
:system "Explain this code concisely in 2-3 sentences."
|
:system "Explain this code concisely in 2-3 sentences."
|
||||||
:callback (lambda (response info)
|
:callback (lambda (response info)
|
||||||
(message "Explanation: %s" response))))))
|
(message "Explanation: %s" response))))))
|
||||||
|
|
||||||
(defun my/gptel-proofread-region ()
|
(defun my/gptel-proofread-region ()
|
||||||
"Proofread and improve selected text."
|
"Proofread and improve selected text."
|
||||||
@@ -183,16 +183,23 @@
|
|||||||
(use-package! claude-code
|
(use-package! claude-code
|
||||||
:defer t
|
:defer t
|
||||||
:config
|
:config
|
||||||
|
;; Unset CLAUDECODE to allow running Claude Code inside Emacs sub-processes
|
||||||
|
(setenv "CLAUDECODE" nil)
|
||||||
(setq claude-code-program "ccr"
|
(setq claude-code-program "ccr"
|
||||||
claude-code-program-switches '("code" "--dangerously-skip-permissions"))
|
claude-code-program-switches '("code" "--dangerously-skip-permissions"))
|
||||||
|
|
||||||
;; Use vterm backend
|
;; Use Eat backend
|
||||||
(setq claude-code-terminal-backend 'eat)
|
(setq claude-code-terminal-backend 'eat
|
||||||
|
;; Emacs-style editing in Claude buffer: RET inserts newline, S-RET sends
|
||||||
|
claude-code-newline-keybinding-style 'shift-return-to-send)
|
||||||
|
|
||||||
;; Enable global mode
|
;; Enable global mode
|
||||||
(claude-code-mode 1)
|
(claude-code-mode 1)
|
||||||
|
|
||||||
;; Set key bindings prefix
|
;; Emacs-style prefix key (works without Doom/Evil leader keys)
|
||||||
|
(global-set-key (kbd "C-c c") claude-code-command-map)
|
||||||
|
|
||||||
|
;; Set Doom leader keybindings
|
||||||
(map! :leader
|
(map! :leader
|
||||||
(:prefix ("C" . "claude-code")
|
(:prefix ("C" . "claude-code")
|
||||||
:desc "Start Claude" "c" #'claude-code
|
:desc "Start Claude" "c" #'claude-code
|
||||||
@@ -237,26 +244,94 @@
|
|||||||
(when (eq claude-code-terminal-backend 'vterm)
|
(when (eq claude-code-terminal-backend 'vterm)
|
||||||
(setq-local vterm-max-scrollback 100000)))))
|
(setq-local vterm-max-scrollback 100000)))))
|
||||||
|
|
||||||
(use-package! claudemacs
|
;;; Gemini CLI Configuration
|
||||||
|
|
||||||
|
(use-package! gemini-cli
|
||||||
:defer t
|
:defer t
|
||||||
:commands (claudemacs claudemacs-transient-menu)
|
|
||||||
:init
|
|
||||||
(setq claudemacs-program "ccr"
|
|
||||||
claudemacs-program-switches '("code" "--dangerously-skip-permissions")
|
|
||||||
claudemacs-default-tool 'claude
|
|
||||||
claudemacs-prefer-projectile-root t)
|
|
||||||
:config
|
:config
|
||||||
(map! :map prog-mode-map
|
;; Set the Gemini executable
|
||||||
"C-c C-e" #'claudemacs-transient-menu)
|
(setq gemini-cli-program "gemini"
|
||||||
(map! :map emacs-lisp-mode-map
|
gemini-cli-program-switches nil)
|
||||||
"C-c C-e" #'claudemacs-transient-menu)
|
|
||||||
(map! :map text-mode-map
|
;; Use Eat backend
|
||||||
"C-c C-e" #'claudemacs-transient-menu)
|
(setq gemini-cli-terminal-backend 'eat
|
||||||
(after! python
|
;; Emacs-style editing in Gemini buffer: RET inserts newline, S-RET sends
|
||||||
(map! :map python-base-mode-map
|
gemini-cli-newline-keybinding-style 'shift-return-to-send)
|
||||||
"C-c C-e" #'claudemacs-transient-menu))
|
|
||||||
(after! eat
|
;; Enable global mode
|
||||||
(setq eat-term-scrollback-size 400000))
|
(gemini-cli-mode 1)
|
||||||
|
|
||||||
|
;; Emacs-style prefix key
|
||||||
|
(global-set-key (kbd "C-c g") gemini-cli-command-map)
|
||||||
|
|
||||||
|
;; Set Doom leader keybindings under SPC G
|
||||||
(map! :leader
|
(map! :leader
|
||||||
(:prefix ("C" . "claude-code")
|
(:prefix ("G" . "gemini-cli")
|
||||||
:desc "Claudemacs menu" "E" #'claudemacs-transient-menu)))
|
:desc "Start Gemini" "c" #'gemini-cli
|
||||||
|
:desc "Start in directory" "d" #'gemini-cli-start-in-directory
|
||||||
|
:desc "Continue conversation" "C" #'gemini-cli-continue
|
||||||
|
:desc "Resume session" "R" #'gemini-cli-resume
|
||||||
|
:desc "New instance" "i" #'gemini-cli-new-instance
|
||||||
|
:desc "Kill Gemini" "k" #'gemini-cli-kill
|
||||||
|
:desc "Kill all instances" "K" #'gemini-cli-kill-all
|
||||||
|
:desc "Send command" "s" #'gemini-cli-send-command
|
||||||
|
:desc "Send command with context" "x" #'gemini-cli-send-command-with-context
|
||||||
|
:desc "Send region/buffer" "r" #'gemini-cli-send-region
|
||||||
|
:desc "Send buffer file" "o" #'gemini-cli-send-buffer-file
|
||||||
|
:desc "Fix error at point" "e" #'gemini-cli-fix-error-at-point
|
||||||
|
:desc "Toggle window" "t" #'gemini-cli-toggle
|
||||||
|
:desc "Switch to buffer" "b" #'gemini-cli-switch-to-buffer
|
||||||
|
:desc "Select buffer" "B" #'gemini-cli-select-buffer
|
||||||
|
:desc "Toggle read-only" "z" #'gemini-cli-toggle-read-only-mode
|
||||||
|
:desc "Cycle mode" "M" #'gemini-cli-cycle-mode
|
||||||
|
:desc "Transient menu" "m" #'gemini-cli-transient
|
||||||
|
:desc "Slash commands" "/" #'gemini-cli-slash-commands
|
||||||
|
:desc "Fork conversation" "f" #'gemini-cli-fork
|
||||||
|
:desc "Send return" "y" #'gemini-cli-send-return
|
||||||
|
:desc "Send escape" "n" #'gemini-cli-send-escape
|
||||||
|
:desc "Send 1" "1" #'gemini-cli-send-1
|
||||||
|
:desc "Send 2" "2" #'gemini-cli-send-2
|
||||||
|
:desc "Send 3" "3" #'gemini-cli-send-3))
|
||||||
|
|
||||||
|
;; Optional: Configure window display (side window on right)
|
||||||
|
(add-to-list 'display-buffer-alist
|
||||||
|
'("^\\*gemini"
|
||||||
|
(display-buffer-in-side-window)
|
||||||
|
(side . right)
|
||||||
|
(window-width . 90)))
|
||||||
|
|
||||||
|
;; Optional: Enable auto-revert for files modified by Gemini
|
||||||
|
;; (global-auto-revert-mode 1)
|
||||||
|
|
||||||
|
;; Optional: Increase vterm scrollback for long conversations
|
||||||
|
(add-hook 'gemini-cli-start-hook
|
||||||
|
(lambda ()
|
||||||
|
(when (eq gemini-cli-terminal-backend 'vterm)
|
||||||
|
(setq-local vterm-max-scrollback 100000)))))
|
||||||
|
|
||||||
|
;; (use-package! claudemacs
|
||||||
|
;; :defer t
|
||||||
|
;; :commands (claudemacs claudemacs-transient-menu)
|
||||||
|
;; :init
|
||||||
|
;; (setq claudemacs-program "ccr"
|
||||||
|
;; claudemacs-program-switches '("code" "--dangerously-skip-permissions")
|
||||||
|
;; claudemacs-default-tool 'claude
|
||||||
|
;; claudemacs-prefer-projectile-root t)
|
||||||
|
;; :config
|
||||||
|
;; (map! :map prog-mode-map
|
||||||
|
;; "C-c C-e" #'claudemacs-transient-menu)
|
||||||
|
;; (map! :map emacs-lisp-mode-map
|
||||||
|
;; "C-c C-e" #'claudemacs-transient-menu)
|
||||||
|
;; (map! :map text-mode-map
|
||||||
|
;; "C-c C-e" #'claudemacs-transient-menu)
|
||||||
|
;; (after! python
|
||||||
|
;; (map! :map python-base-mode-map
|
||||||
|
;; "C-c C-e" #'claudemacs-transient-menu))
|
||||||
|
;; (after! eat
|
||||||
|
;; (setq eat-term-scrollback-size 400000)
|
||||||
|
;; (add-hook 'eat-mode-hook
|
||||||
|
;; (lambda ()
|
||||||
|
;; (setq-local show-trailing-whitespace nil))))
|
||||||
|
;; (map! :leader
|
||||||
|
;; (:prefix ("C" . "claude-code")
|
||||||
|
;; :desc "Claudemacs menu" "E" #'claudemacs-transient-menu)))
|
||||||
|
|||||||
@@ -12,6 +12,9 @@
|
|||||||
(setq super-save-auto-save-when-idle t)
|
(setq super-save-auto-save-when-idle t)
|
||||||
(setq super-save-idle-duration 1))
|
(setq super-save-idle-duration 1))
|
||||||
|
|
||||||
|
;; Which-key: show keybindings faster
|
||||||
|
(setq which-key-idle-delay 0.01
|
||||||
|
which-key-min-display-time 0.1)
|
||||||
|
|
||||||
;; Search bindings for consult-line
|
;; Search bindings for consult-line
|
||||||
(map!
|
(map!
|
||||||
@@ -19,4 +22,4 @@
|
|||||||
:n "M-s" (lambda () (interactive) (consult-line (thing-at-point 'symbol)))
|
:n "M-s" (lambda () (interactive) (consult-line (thing-at-point 'symbol)))
|
||||||
:n "C-S-s" #'consult-line-multi)
|
:n "C-S-s" #'consult-line-multi)
|
||||||
|
|
||||||
(setq-default show-trailing-whitespace t)
|
(setq-default show-trailing-whitespace nil)
|
||||||
|
|||||||
@@ -144,3 +144,8 @@
|
|||||||
(setq lsp-clients-clangd-executable "clangd")
|
(setq lsp-clients-clangd-executable "clangd")
|
||||||
(setq lsp-clients--clangd-default-executable "clangd")
|
(setq lsp-clients--clangd-default-executable "clangd")
|
||||||
(setq lsp-clangd-binary-path "clangd"))
|
(setq lsp-clangd-binary-path "clangd"))
|
||||||
|
|
||||||
|
;; Justfile mode (psibi/justl.el)
|
||||||
|
(use-package! justl
|
||||||
|
:config
|
||||||
|
(map! :n "e" 'justl-exec-recipe))
|
||||||
|
|||||||
@@ -48,6 +48,7 @@
|
|||||||
;;unicode ; extended unicode support for various languages
|
;;unicode ; extended unicode support for various languages
|
||||||
(vc-gutter +pretty) ; vcs diff in the fringe
|
(vc-gutter +pretty) ; vcs diff in the fringe
|
||||||
vi-tilde-fringe ; fringe tildes to mark beyond EOB
|
vi-tilde-fringe ; fringe tildes to mark beyond EOB
|
||||||
|
(which-key +popup) ; key binding popups
|
||||||
window-select ; visually switch windows
|
window-select ; visually switch windows
|
||||||
workspaces ; tab emulation, persistence & separate workspaces
|
workspaces ; tab emulation, persistence & separate workspaces
|
||||||
zen ; distraction-free coding or writing
|
zen ; distraction-free coding or writing
|
||||||
|
|||||||
+19
@@ -47,13 +47,32 @@
|
|||||||
|
|
||||||
(package! consult)
|
(package! consult)
|
||||||
|
|
||||||
|
(package! popup)
|
||||||
|
|
||||||
(package! claude-code
|
(package! claude-code
|
||||||
:recipe (:host github :repo "stevemolitor/claude-code.el" :branch "main" :depth 1
|
:recipe (:host github :repo "stevemolitor/claude-code.el" :branch "main" :depth 1
|
||||||
:files ("*.el" (:exclude "images/*"))))
|
:files ("*.el" (:exclude "images/*"))))
|
||||||
|
|
||||||
|
(package! gemini-cli
|
||||||
|
:recipe (:host github :repo "linchen2chris/gemini-cli.el" :branch "main"
|
||||||
|
:files ("*.el" (:exclude "demo.gif"))))
|
||||||
|
|
||||||
(package! claudemacs
|
(package! claudemacs
|
||||||
:recipe (:host github :repo "cpoile/claudemacs"))
|
:recipe (:host github :repo "cpoile/claudemacs"))
|
||||||
|
|
||||||
|
;; Terminal emulator
|
||||||
|
(package! eat
|
||||||
|
:recipe (:host codeberg
|
||||||
|
:repo "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"))))
|
||||||
|
|
||||||
|
;; Justfile mode
|
||||||
|
(package! justl :recipe (:host github :repo "psibi/justl.el"))
|
||||||
|
|
||||||
;; Usage metrics and key tracking
|
;; Usage metrics and key tracking
|
||||||
(package! keyfreq)
|
(package! keyfreq)
|
||||||
(package! command-log-mode)
|
(package! command-log-mode)
|
||||||
|
|||||||
@@ -9,11 +9,14 @@
|
|||||||
|
|
||||||
(use-package! ewal-doom-themes
|
(use-package! ewal-doom-themes
|
||||||
:config
|
:config
|
||||||
(load-theme 'ewal-doom-one t)
|
;; (load-theme 'ewal-doom-one t)
|
||||||
(enable-theme 'ewal-doom-one))
|
;;(enable-theme 'ewal-doom-one)
|
||||||
|
)
|
||||||
|
|
||||||
;; Set the theme to ewal-doom-one
|
;; Set the theme to ewal-doom-one
|
||||||
(setq doom-theme 'ewal-doom-one)
|
;; (setq doom-theme 'ewal-doom-one)
|
||||||
|
(load-theme 'doom-one t)
|
||||||
|
(setq doom-theme 'doom-one)
|
||||||
|
|
||||||
;; Previous base16 config (commented out)
|
;; Previous base16 config (commented out)
|
||||||
;; (setq base16-distinct-fringe-background t
|
;; (setq base16-distinct-fringe-background t
|
||||||
|
|||||||
Reference in New Issue
Block a user