Emacs: Switch to claude

This commit is contained in:
Joseph Ferano 2024-10-29 09:57:53 +07:00
parent 0d00ca98d1
commit c372a404e2

View File

@ -1178,7 +1178,7 @@ Ace Window will show a hint if there are more than 2 windows, but I don't really
(interactive)
(let ((curr (current-buffer)))
(mode-line-other-buffer)
(beframe-unassume-current-frame-buffers-selectively '(curr))))
(beframe-unassume-current-frame-buffers-selectively (list curr))))
(evil-global-set-key 'normal (kbd "SPC b f") #'joe/beframe-switch-and-unassume)
#+end_src
@ -1687,13 +1687,21 @@ Stuff to immediately switch to Jetbrains for debugging
(require 'embark)
#+end_src
Add a beframe keybinding to unassume a buffer with embark
#+begin_src emacs-lisp
(define-key embark-buffer-map (kbd "b") #'beframe-unassume-current-frame-buffers-selectively)
#+end_src
These two lines allow you to kill buffers without a confirmation and without
closing the mini-buffer so you can quickly kill multiple buffers if needed. The
odd looking ~'(t .t)~ is for specifying a default for all other actions.
#+begin_src emacs-lisp
(setq embark-quit-after-action '((t . t)
(kill-buffer . nil)))
(kill-buffer . nil)
;; (beframe-unassume-current-frame-buffers-selectively . nil)))
(joe/beframe-unassume-and-refresh-consult . nil)))
(setf (alist-get 'kill-buffer embark-pre-action-hooks) nil)
#+end_src
@ -2354,11 +2362,17 @@ These help speed eglot up apparently [[https://www.reddit.com/r/emacs/comments/1
** AI
#+begin_src emacs-lisp
(setq gptel-default-mode #'org-mode)
(setq gptel-model "gpt-4")
(setq gptel-model "claude-3-opus")
(setq gptel-api-key (with-temp-buffer
(insert-file-contents (expand-file-name "gptel-key" user-emacs-directory))
(buffer-string)))
;; OPTIONAL configuration
(setq
gptel-model 'claude-3-sonnet-20240229 ; "claude-3-opus-20240229" also available
gptel-backend (gptel-make-anthropic "Claude"
:stream t :key (with-temp-buffer
(insert-file-contents (expand-file-name "gptel-key" user-emacs-directory))
(buffer-string))))
(add-hook 'gptel-post-response-functions #'font-lock-ensure)
#+end_src