reddit / emacs
Another unofficial Copilot plugin for Emacs!
r4nd0mzr · 2022-03-26 21:25
GitHub repo: [https://github.com/zerolfx/copilot.el](https://github.com/zerolfx/copilot.el)
https://i.redd.it/eoa8bzavnsp81.gif
[Here](https://www.reddit.com/r/emacs/comments/s3969u/flightattendantel_unofficial_plugin_for_github/) is another post for an unofficial Copilot plugin named `flight-attendant.el`. It seems no longer maintained, so I wrote a new one, additionally supporting up-to-date Copilot client, accepting completion and better integration with company-mode.
The plugin is still under development, and I only tested its compatibility under Linux + Spacemacs.
Since it's my very first elisp project, any tips or advice are welcome, thank you!
​
Update: the plugin is stable now.
[deleted] · 2022-03-26 23:40
[deleted]
servytor · 2022-03-26 23:41
That is awesome! Thank you for writing it.
ndpian · 2022-03-27 03:07
very cool / interesting, but why does it require Neovim installation?
r4nd0mzr · 2022-03-27 03:26
I agree that it sounds wired.
For now, copilot.el relies on Neovim for logging into GitHub and getting an access token.
I will remove Neovim dependency later by adding login logic.
Update: Now you can use copilot.el without Neovim!
ndpian · 2022-03-27 03:37
Ah I see, makes sense!
takutekato · 2022-03-29 05:02
Thank you for this awesome package!
I installed it through straight and upon calling `copilot-login` Emacs throwed this error:
`copilot--start-process: Wrong number of arguments: #<subr s-trim>, 0`
You forgot to add `(require 'dash)`, `->>` is a macro so `dash` should be included at compile time to fix the above error.
And having `copilot-login`, among with some others autoloaded should be great, too!
r4nd0mzr · 2022-03-29 06:26
Thanks for pointing out the bug.
I start to use `flycheck-mode`, and will have no more missing requires then.
cwage · 2022-04-28 20:49
This looks super cool -- I noticed you said you tested it in spacemacs, which I am also using (albeit in mac OS X), but I'm not getting far with the installation. afaict spacemacs doesn't use straight.el (might be wrong about this?) so the automatic installation doesn't work for me..
I tried doing it manually but I don't see any of the mentioned dependencies when i do M-x package-install
Any tips?
r4nd0mzr · 2022-05-03 19:56
Spacemacs doesn't support straight.el, so we can only load it manually. These dependencies are already installed in spacemacs, so you don't need to worry about it.
cwage · 2022-05-03 20:16
gotcha, okay, I'll give it another whirl. Thanks!
cwage · 2022-05-03 22:51
Got it working. Turns out the manual steps worked fine, just my .spacemacs config was so old the user init section had changed entirely. Thanks again!
Distinct_Ad_7779 · 2022-06-29 13:47
I installed it on Doom, Spacemacs and Centaur.
My main driver is Centaur, but so far I cannot make <TAB> work as desired (copied the config from the instructions)
`;; you can utilize :map :hook and :config to customize copilot`
`(defun my-tab ()`
`(interactive)`
`(or (copilot-accept-completion)`
`(company-indent-or-complete-common nil)))`
`(use-package copilot`
`:hook (prog-mode . copilot-mode)`
`:bind (("C-TAB" . 'copilot-accept-completion-by-word)`
`("C-<tab>" . 'copilot-accept-completion-by-word)`
`:map company-active-map`
`("<tab>" . 'my-tab)`
`("TAB" . 'my-tab)`
`:map company-mode-map`
`("<tab>" . 'my-tab)`
`("TAB" . 'my-tab)))`
Any thoughts or recomendations?
Thank you