Add chatgpt-shell config

This commit is contained in:
2023-03-23 17:49:28 +00:00
parent cda6beed34
commit fbfa5e04a8
3 changed files with 26 additions and 0 deletions

View File

@@ -1306,6 +1306,28 @@
'clang-format-region-or-buffer)))
#+end_src
** ChatGPT
The =chatpt-shell= package is in a git submodule, so this has to be
added to the [[help:load-path][load-path]] and ~require~'d:
#+begin_src emacs-lisp
(let ((path (concat (getenv "HOME")
"/.emacs.d/chatgpt-shell")))
(add-to-list 'load-path path))
(require 'chatgpt-shell)
#+end_src
[[help:chatgpt-shell-openai-key][chatgpt-shell-openai-key]] must also be set to a function that
returns an OpenAI API key. I have a key (made on [[https://platform.openai.com/account/api-keys][this page]]) stored
in =pass(1)= under =openai/api-key=, so this can be retrieved via
[[help:process-lines][process-lines]]:
#+begin_src emacs-lisp
(setq chatgpt-shell-openai-key
(lambda ()
(car (process-lines "pass" "openai/api-key"))))
#+end_src
* Backup and Autosave
** Keep $PWD Tidy
Emacs' default behaviour of dumping temporary files in the current