summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Gonzalez <roger@rogs.me>2023-04-19 17:35:59 -0300
committerRoger Gonzalez <roger@rogs.me>2023-04-19 17:35:59 -0300
commit6b33134d7eb7fac21352de6e9000338a88d890ad (patch)
tree14cd44765c99df8d7dea21f4f7b853cf6b22ae18
parent02c34c7780979e63c6ef7cd20ecc6432ae90861e (diff)
Updated chatgpt-shell, added Copilot and PlantUML
-rw-r--r--.config/doom/config.el27
-rw-r--r--.config/doom/custom-packages/ob-chatgpt-shell.el5
-rw-r--r--.config/doom/init.el2
-rw-r--r--.config/doom/packages.el4
4 files changed, 35 insertions, 3 deletions
diff --git a/.config/doom/config.el b/.config/doom/config.el
index 5d413c34..bd09e109 100644
--- a/.config/doom/config.el
+++ b/.config/doom/config.el
@@ -464,6 +464,10 @@ text and copying to the killring."
("git.suckless.org" nil "git.suckless.org" forge-stagit-repository)
("git.sr.ht" nil "git.sr.ht" forge-srht-repository)))
+;; Misc
+
+(beacon-mode t)
+
;; ChatGPT
(require 'chatgpt-shell)
(require 'ob-chatgpt-shell)
@@ -471,3 +475,26 @@ text and copying to the killring."
(setq chatgpt-shell-chatgpt-model-version "gpt-3.5-turbo")
(setq chatgpt-shell-chatgpt-streaming "t")
(setq chatgpt-shell-chatgpt-system-prompt "You are a senior Python developer in charge of maintaining a very big application")
+
+;; Github Copilot
+;; accept completion from copilot and fallback to company
+;; More info https://robert.kra.hn/posts/2023-02-22-copilot-emacs-setup/
+(use-package! copilot
+ :hook (prog-mode . copilot-mode)
+ :bind (:map copilot-completion-map
+ ("<tab>" . 'copilot-accept-completion)
+ ("TAB" . 'copilot-accept-completion)
+ ("C-TAB" . 'copilot-accept-completion-by-word)
+ ("C-<tab>" . 'copilot-accept-completion-by-word)))
+
+;; PlantUML
+(setq plantuml-executable-path "/usr/bin/plantuml")
+(setq plantuml-default-exec-mode 'executable)
+(setq org-plantuml-exec-mode 'plantuml)
+(setq plantuml-server-url 'nil)
+
+(add-to-list 'org-src-lang-modes '("plantuml" . plantuml))
+(org-babel-do-load-languages 'org-babel-load-languages '((plantuml . t)))
+(add-to-list 'auto-mode-alist '("\\.plantuml\\'" . plantuml-mode))
+(setq org-babel-default-header-args:plantuml
+ '((:results . "verbatim") (:exports . "results") (:cache . "no")))
diff --git a/.config/doom/custom-packages/ob-chatgpt-shell.el b/.config/doom/custom-packages/ob-chatgpt-shell.el
index e612aabd..7b7318fc 100644
--- a/.config/doom/custom-packages/ob-chatgpt-shell.el
+++ b/.config/doom/custom-packages/ob-chatgpt-shell.el
@@ -58,8 +58,9 @@ This function is called by `org-babel-execute-src-block'"
(message "executing ChatGPT source code block")
(if (map-elt params :preface)
(chatgpt-shell-post-chatgpt-messages
- (append preface `(((role . "user")
- (content . ,body))))
+ (vconcat (map-elt params :preface)
+ `(((role . "user")
+ (content . ,body))))
(map-elt params :version))
(chatgpt-shell-post-chatgpt-prompt body (map-elt params :version))))
diff --git a/.config/doom/init.el b/.config/doom/init.el
index 91a808e9..754e12d1 100644
--- a/.config/doom/init.el
+++ b/.config/doom/init.el
@@ -21,7 +21,7 @@
;;layout ; auie,ctsrnm is the superior home row
:completion
- company ; the ultimate code completion backend
+ (company +childframe) ; the ultimate code completion backend
helm ; the *other* search engine for love and life
;;ido ; the other *other* search engine...
ivy ; a search engine for love and life
diff --git a/.config/doom/packages.el b/.config/doom/packages.el
index 61ebc378..f1f46225 100644
--- a/.config/doom/packages.el
+++ b/.config/doom/packages.el
@@ -61,3 +61,7 @@
(package! dashboard)
(package! clipmon)
(package! butler)
+(package! copilot
+ :recipe (:host github :repo "zerolfx/copilot.el" :files ("*.el" "dist")))
+(package! beacon)
+(package! plantuml-mode)