Add chatgpt-shell config

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

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "chatgpt-shell"]
path = chatgpt-shell
url = https://github.com/xenodium/chatgpt-shell

1
chatgpt-shell Submodule

@ -0,0 +1 @@
Subproject commit f7a53903ebedb1bd67dc9dea6ae9893fb70d4d49

View File

@ -1306,6 +1306,28 @@
'clang-format-region-or-buffer))) 'clang-format-region-or-buffer)))
#+end_src #+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 * Backup and Autosave
** Keep $PWD Tidy ** Keep $PWD Tidy
Emacs' default behaviour of dumping temporary files in the current Emacs' default behaviour of dumping temporary files in the current