From 1535511052f0bb23c57e4dd0aca3f3cc9817afab Mon Sep 17 00:00:00 2001 From: James Patrick Date: Tue, 18 Jun 2024 17:46:26 -0400 Subject: [PATCH] Added copilot --- emacs/config.el | 8 ++++++++ emacs/config.org | 31 ++++++++++++++++++++++++++++++- emacs/packages.el | 3 +++ 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/emacs/config.el b/emacs/config.el index cfada82..670983a 100644 --- a/emacs/config.el +++ b/emacs/config.el @@ -38,3 +38,11 @@ (load! "+orgmode") (use-package! gptel) + +(use-package! copilot + :hook (prog-mode . copilot-mode) + :bind (:map copilot-completion-map + ("" . 'copilot-accept-completion) + ("TAB" . 'copilot-accept-completion) + ("C-TAB" . 'copilot-accept-completion-by-word) + ("C-" . 'copilot-accept-completion-by-word))) diff --git a/emacs/config.org b/emacs/config.org index 4320ec4..3b5c761 100644 --- a/emacs/config.org +++ b/emacs/config.org @@ -984,7 +984,10 @@ The default =+org-capture/open-frame= is a little small. Let's modify the parame #+end_src * GPT -GPT is more useful than I thought. Its incredibly helpful for writing prose which I can struggle with due to mild dysgraphia. We will be using the [[https://github.com/karthink/gptel][karthink/gptel]] package. +GPT is more useful than I thought. Its incredibly helpful for writing prose which I can struggle with due to mild dysgraphia. + +** ChatGPT +We will be using the [[https://github.com/karthink/gptel][karthink/gptel]] package. #+BEGIN_SRC emacs-lisp :tangle "packages.el" (package! gptel) @@ -1000,6 +1003,32 @@ This package supports multiple LLM backends. I'm going to be using the OpenAI Ch machine api.openai.com login apikey password TOKEN #+end_src +** TRAIL_RUN CoPilot +I'm presently using GitHub copilot for work. It can best be summarized as having a intern periodically writing code for you. The code quality is so-so, and often buggy or incorrect. You will often spend as long debugging some of the code as you would have saved writing it yourself. But it is useful for the rote drudgery that occurs with some coding. + +For this I'm going to use [[https://github.com/copilot-emacs/copilot.el][copilot-emacs/copilot.el]]. + +First install the package +#+BEGIN_SRC emacs-lisp :tangle "packages.el" +(package! copilot + :recipe (:host github :repo "copilot-emacs/copilot.el" :files ("*.el"))) +#+END_SRC + +Then configure this +#+begin_src emacs-lisp +(use-package! copilot + :hook (prog-mode . copilot-mode) + :bind (:map copilot-completion-map + ("" . 'copilot-accept-completion) + ("TAB" . 'copilot-accept-completion) + ("C-TAB" . 'copilot-accept-completion-by-word) + ("C-" . 'copilot-accept-completion-by-word))) +#+end_src + +This does bind to company, which I've currently removed. See [[*Completion][Completion]] for specifics. + + + ** Keybinds | Keybind | Command | diff --git a/emacs/packages.el b/emacs/packages.el index f1acdfa..44bcb90 100644 --- a/emacs/packages.el +++ b/emacs/packages.el @@ -7,3 +7,6 @@ (package! ox-tufte) (package! gptel) + +(package! copilot + :recipe (:host github :repo "copilot-emacs/copilot.el" :files ("*.el")))