Copilot
This commit is contained in:
18
config.el
18
config.el
@@ -16,3 +16,21 @@
|
|||||||
(when (eq system-type 'darwin)
|
(when (eq system-type 'darwin)
|
||||||
(define-key eat-semi-char-mode-map (kbd "C-h") #'eat-self-input)
|
(define-key eat-semi-char-mode-map (kbd "C-h") #'eat-self-input)
|
||||||
(define-key eat-semi-char-mode-map (kbd "<backspace>") (kbd "C-h"))))
|
(define-key eat-semi-char-mode-map (kbd "<backspace>") (kbd "C-h"))))
|
||||||
|
|
||||||
|
;; accept completion from copilot and fallback to company
|
||||||
|
(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)
|
||||||
|
("C-n" . 'copilot-next-completion)
|
||||||
|
("C-p" . 'copilot-previous-completion))
|
||||||
|
|
||||||
|
:config
|
||||||
|
(add-to-list 'copilot-indentation-alist '(prog-mode 2))
|
||||||
|
(add-to-list 'copilot-indentation-alist '(org-mode 2))
|
||||||
|
(add-to-list 'copilot-indentation-alist '(text-mode 2))
|
||||||
|
(add-to-list 'copilot-indentation-alist '(clojure-mode 2))
|
||||||
|
(add-to-list 'copilot-indentation-alist '(emacs-lisp-mode 2)))
|
||||||
|
|||||||
28
config.org
28
config.org
@@ -1,5 +1,4 @@
|
|||||||
* My doom config
|
* My doom config
|
||||||
|
|
||||||
** Appearance settings
|
** Appearance settings
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(setq doom-font (font-spec :family "Maple Mono" :size 20))
|
(setq doom-font (font-spec :family "Maple Mono" :size 20))
|
||||||
@@ -42,3 +41,30 @@ Fix the issue that backspace doesn't work on mac
|
|||||||
(define-key eat-semi-char-mode-map (kbd "C-h") #'eat-self-input)
|
(define-key eat-semi-char-mode-map (kbd "C-h") #'eat-self-input)
|
||||||
(define-key eat-semi-char-mode-map (kbd "<backspace>") (kbd "C-h"))))
|
(define-key eat-semi-char-mode-map (kbd "<backspace>") (kbd "C-h"))))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
*** Copilot
|
||||||
|
#+begin_src emacs-lisp :tangle packages.el
|
||||||
|
(package! copilot
|
||||||
|
:recipe (:host github :repo "copilot-emacs/copilot.el" :files ("*.el")))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
Configuration
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
;; accept completion from copilot and fallback to company
|
||||||
|
(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)
|
||||||
|
("C-n" . 'copilot-next-completion)
|
||||||
|
("C-p" . 'copilot-previous-completion))
|
||||||
|
|
||||||
|
:config
|
||||||
|
(add-to-list 'copilot-indentation-alist '(prog-mode 2))
|
||||||
|
(add-to-list 'copilot-indentation-alist '(org-mode 2))
|
||||||
|
(add-to-list 'copilot-indentation-alist '(text-mode 2))
|
||||||
|
(add-to-list 'copilot-indentation-alist '(clojure-mode 2))
|
||||||
|
(add-to-list 'copilot-indentation-alist '(emacs-lisp-mode 2)))
|
||||||
|
#+end_src
|
||||||
|
|||||||
@@ -7,3 +7,6 @@
|
|||||||
("terminfo/65" "terminfo/65/*")
|
("terminfo/65" "terminfo/65/*")
|
||||||
("integration" "integration/*")
|
("integration" "integration/*")
|
||||||
(:exclude ".dir-locals.el" "*-tests.el"))))
|
(:exclude ".dir-locals.el" "*-tests.el"))))
|
||||||
|
|
||||||
|
(package! copilot
|
||||||
|
:recipe (:host github :repo "copilot-emacs/copilot.el" :files ("*.el")))
|
||||||
|
|||||||
Reference in New Issue
Block a user