Follow instructions at acheong08/ChatGPT and create config.json
in your home directory, not local.
(use-package chatgpt
:straight (:host github :repo "joshcho/ChatGPT.el" :files ("dist" "*.el"))
:bind ("C-c q" . chatgpt-query)
:config
(setq chatgpt-repo-path "~/.emacs.d/straight/repos/ChatGPT.el/"))
(quelpa '(chatgpt :fetcher git :url "https://github.com/joshcho/ChatGPT.el.git"))
(use-package chatgpt
:quelpa t
:bind ("C-c q" . chatgpt-query)
:config
(setq chatgpt-repo-path (expand-file-name "ChatGPT.el" quelpa-build-dir)))
- Press
C-c q
to query ChatGPT. - Select region before
C-c q
to query ChatGPT by type.
Customize chatgpt-query-types
for your own types.
(setq chatgpt-query-types '(
;; ChatGPT.el defaults
("doc" . "Please write the documentation for the following function.\n\n%s")
("bug" . "There is a bug in the following function, please help me fix it.\n\n%s")
("understand" . "What does the following function do?\n\n%s")
("improve" . "Please improve the following code.\n\n%s")
;; your new prompt
("my-custom-type" . "My custom prompt.\n\n%s")))
- Don’t use “custom” as a type. It’s reserved for custom prepend string through minibuffer.
- Authenticate using browser
- Add more query types
- Add structure to \*ChatGPT\* buffer
- Don’t force
config.json
in home