summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Gonzalez <roger@rogs.me>2024-09-04 17:22:07 -0300
committerRoger Gonzalez <roger@rogs.me>2024-09-04 17:22:07 -0300
commit9b502052d3c8cfef061ed0ed2456fe02ac9f0d2f (patch)
treebf673baaaa55b3ec485951e7e6f4aa2995eba53b
parent44852f4d927b8786012ace85f7db3dbafca87833 (diff)
Improved GPT features in EmacsHEADmaster
-rw-r--r--.config/doom/config.el15
-rw-r--r--.config/doom/config.org32
-rw-r--r--.config/doom/custom-packages/private.el.example4
-rw-r--r--.config/doom/custom.el4
-rw-r--r--.config/doom/packages.el1
5 files changed, 48 insertions, 8 deletions
diff --git a/.config/doom/config.el b/.config/doom/config.el
index d86b6492..9d67a4d2 100644
--- a/.config/doom/config.el
+++ b/.config/doom/config.el
@@ -346,9 +346,20 @@ text and copying to the killring."
(add-hook 'magit-mode-hook (lambda () (magit-delta-mode +1)))
-(setq chatgpt-shell-model-version "gpt-4-1106-preview")
+(setq chatgpt-shell-model-version "gpt-4o")
(setq chatgpt-shell-streaming "t")
(setq chatgpt-shell-system-prompt "You are a senior developer knowledgeable in every programming language")
+(setq chatgpt-shell-openai-key openai-key)
+(setq dall-e-shell-openai-key openai-key)
+
+(require 'llm-openai)
+(setq magit-gptcommit-llm-provider (make-llm-openai :key openai-key))
+(setq llm-warn-on-nonfree nil)
+
+(after! magit
+ (magit-gptcommit-mode 1)
+ (setq magit-gptcommit-prompt "You are an expert programmer writing a commit message. You went over every file diff that was changed in it. Summarize the commit into a single specific and cohesive theme. Remember to write in only one line, no more than 50 characters. Write your response using the imperative tense following the kernel git commit style guide. Write a high level title. THE FILE DIFFS:```%s```. Now write Commit message in follow template: [one line of summary]")
+ (magit-gptcommit-status-buffer-setup))
(use-package! copilot
:hook (prog-mode . copilot-mode)
@@ -368,4 +379,4 @@ text and copying to the killring."
(setq org-babel-default-header-args:plantuml
'((:results . "verbatim") (:exports . "results") (:cache . "no")))
(after! org
-(add-to-list 'org-src-lang-modes '("plantuml" . plantuml)))
+ (add-to-list 'org-src-lang-modes '("plantuml" . plantuml)))
diff --git a/.config/doom/config.org b/.config/doom/config.org
index 171e398c..776132a9 100644
--- a/.config/doom/config.org
+++ b/.config/doom/config.org
@@ -546,11 +546,34 @@ I had to do this to manage multiple git profiles.
:ID: 0a32d2a9-2156-42a3-90f7-419ac1a25496
:END:
+*** ChatGPT Shell
+:PROPERTIES:
+:ID: 9bdfbd96-deec-4335-8d2c-77fff0283708
+:END:
+
#+begin_src emacs-lisp
-(setq chatgpt-shell-model-version "gpt-4-1106-preview")
+(setq chatgpt-shell-model-version "gpt-4o")
(setq chatgpt-shell-streaming "t")
(setq chatgpt-shell-system-prompt "You are a senior developer knowledgeable in every programming language")
+(setq chatgpt-shell-openai-key openai-key)
+(setq dall-e-shell-openai-key openai-key)
+#+end_src
+*** Magit GPT
+:PROPERTIES:
+:ID: 3f720f16-b7a3-4127-81e9-87d849827639
+:END:
+
+#+begin_src emacs-lisp
+(require 'llm-openai)
+(setq magit-gptcommit-llm-provider (make-llm-openai :key openai-key))
+(setq llm-warn-on-nonfree nil)
+
+(after! magit
+ (magit-gptcommit-mode 1)
+ (setq magit-gptcommit-prompt "You are an expert programmer writing a commit message. You went over every file diff that was changed in it. Summarize the commit into a single specific and cohesive theme. Remember to write in only one line, no more than 50 characters. Write your response using the imperative tense following the kernel git commit style guide. Write a high level title. THE FILE DIFFS:```%s```. Now write Commit message in follow template: [one line of summary]")
+ (magit-gptcommit-status-buffer-setup))
#+end_src
+
** Github Copilot
:PROPERTIES:
:ID: 7f88ce20-846c-47e4-aeed-d853212c9db5
@@ -582,5 +605,10 @@ I had to do this to manage multiple git profiles.
(setq org-babel-default-header-args:plantuml
'((:results . "verbatim") (:exports . "results") (:cache . "no")))
(after! org
-(add-to-list 'org-src-lang-modes '("plantuml" . plantuml)))
+ (add-to-list 'org-src-lang-modes '("plantuml" . plantuml)))
#+end_src
+
+** Magit GPT
+:PROPERTIES:
+:ID: e7d6eea5-9fc2-478c-9bb3-6eb6c5665875
+:END:
diff --git a/.config/doom/custom-packages/private.el.example b/.config/doom/custom-packages/private.el.example
index 73355fb1..6b71a3d1 100644
--- a/.config/doom/custom-packages/private.el.example
+++ b/.config/doom/custom-packages/private.el.example
@@ -1,7 +1,5 @@
;;; custom-packages/private.el -*- lexical-binding: t; -*-
-
-(setq chatgpt-shell-openai-key "my-openai-key")
-(setq dall-e-shell-openai-key "my-openai-key")
+(defvar openai-key "a-big-openai-key")
(provide 'private)
diff --git a/.config/doom/custom.el b/.config/doom/custom.el
index 3c0a1382..6dd06f51 100644
--- a/.config/doom/custom.el
+++ b/.config/doom/custom.el
@@ -5,7 +5,9 @@
;; If there is more than one, they won't work right.
'(magit-todos-insert-after '(bottom) nil nil "Changed by setter of obsolete option `magit-todos-insert-at'")
'(safe-local-variable-values
- '((lsp-pylsp-plugins-ruff-enabled . t)
+ '((magit-gptcommit-prompt . "You are an expert programmer writing a commit message. You went over every file diff that was changed in it. Summarize the commit into a single specific and cohesive theme. Remember to write in only one line, no more than 50 characters. Write your response using the imperative tense following the kernel git commit style guide. Write a high level title. THE FILE DIFFS:```%s```. Now write Commit message in follow template: [one line of summary]")
+ (lsp-eslint-working-directories . \./src)
+ (lsp-pylsp-plugins-ruff-enabled . t)
(poetry-tracking-strategy . "projectile")
(poetry-tracking-mode quote projectile)
(poetry-tracking-strategy quote projectile)
diff --git a/.config/doom/packages.el b/.config/doom/packages.el
index 7d16239f..0df2bb35 100644
--- a/.config/doom/packages.el
+++ b/.config/doom/packages.el
@@ -73,3 +73,4 @@
(package! ox-slack)
(package! org-auto-tangle)
(package! auto-virtualenv)
+(package! magit-gptcommit)