add copilot to config

Amolith created

Change summary

dot_config/doom/config.org.tmpl | 11 +++++++++++
dot_config/doom/init.el         |  2 +-
dot_config/doom/packages.el     |  3 +++
3 files changed, 15 insertions(+), 1 deletion(-)

Detailed changes

dot_config/doom/config.org.tmpl 🔗

@@ -333,3 +333,14 @@ Following established Doom conventions, bind ~SPC g p~ to
 #+BEGIN_SRC emacs-lisp
 (map! :leader :desc "Push upstream" "g p" #'magit-push-current-to-upstream)
 #+END_SRC
+
+* Copilot
+#+BEGIN_SRC emacs-lisp
+(use-package! copilot
+  :hook (prog-mode . copilot-mode)
+  :bind (("C-TAB" . 'copilot-accept-completion-by-word)
+         ("C-<tab>" . 'copilot-accept-completion-by-word)
+         :map copilot-completion-map
+         ("<tab>" . 'copilot-accept-completion)
+         ("TAB" . 'copilot-accept-completion)))
+#+END_SRC

dot_config/doom/init.el 🔗

@@ -20,7 +20,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

dot_config/doom/packages.el 🔗

@@ -41,6 +41,9 @@
 (package! org-ref
   :recipe (:host github :repo "jkitchin/org-ref"))
 
+(package! copilot
+  :recipe (:host github :repo "zerolfx/copilot.el" :files ("*.el" "dist")))
+
 ;; If the package you are trying to install does not contain a PACKAGENAME.el
 ;; file, or is located in a subdirectory of the repo, you'll need to specify
 ;; `:files' in the `:recipe':