Skip to content

Instantly share code, notes, and snippets.

@mopemope
Created March 31, 2022 06:49
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mopemope/ce74191cd43fe7f1a63ab083f51e2b07 to your computer and use it in GitHub Desktop.
Save mopemope/ce74191cd43fe7f1a63ab083f51e2b07 to your computer and use it in GitHub Desktop.
(use-package copilot
:straight (:host github :repo "zerolfx/copilot.el" :files ("dist" "copilot.el"))
:ensure t
:config
(global-unset-key (kbd "TAB"))
(global-set-key (kbd "TAB") (lambda (&optional ARG)
(interactive)
(or (copilot-accept-completion)
(indent-for-tab-command ARG))))
(with-eval-after-load 'company
(delq 'company-preview-if-just-one-frontend company-frontends))
(add-hook 'after-change-functions (lambda (beg end len)
(copilot-clear-overlay)
(copilot-complete))
(add-hook 'post-command-hook (lambda () (copilot-clear-overlay)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment