Skip to content

Commit 45e3bcc

Browse files
authored
Create README.md
Add setup and install instructions.
1 parent 458209e commit 45e3bcc

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# copilot.lua
2+
3+
This plugin is the pure lua replacement for https://github.com/github/copilot.vim
4+
5+
While using copilot.vim, for the first time since I started using neovim my laptop began to overheat. Additionally, I found the large chunks of ghost text moving around my code, and interfering with my existing cmp ghost text disturbing. As lua is far more efficient and make things easier to integrate with modern plugins, this repository was created.
6+
7+
## (IMPORTANT) Usage:
8+
Note that this plugin will only start up the copilot server. The current usage of this is via https://github.com/zbirenbaum/copilot-cmp, which turns copilot suggestions into menu entries for cmp, and displays the full text body in a float, similar to how documentation would appear, off to the side.
9+
10+
On its own, this plugin will do nothing. You must either use https://github.com/zbirenbaum/copilot-cmp to make the server into a cmp source, or write your own plugin to interface with it, via the request and handler methods located in copilot.utils.lua
11+
12+
## Install
13+
14+
### Preliminary Steps
15+
Currently, you must have had the original copilot.vim installed and set up at some point, as the authentication steps you do during its setup create files in ~/.config/github-copilot which copilot.lua must read from to function. Fairly soon, copilot.lua will be able to perform this authentication step on its own, but as the plugin is in early stages, this has not yet been fully implemented.
16+
17+
Install copilot.vim with `use {"github/copilot.vim"}`, `:PackerSync`, restart, and run `:Copilot` to be prompted for the necessary setup steps.
18+
19+
After the setup steps are complete for copilot.vim, ensure that ~/.config/github-copilot has files in it, and then you are free to uninstall copilot.vim and proceed to the following steps.
20+
21+
### Setup
22+
Because the copilot server takes some time to start up, I HIGHLY recommend that you load copilot after startup. This can be done in multiple ways:
23+
1. On 'InsertEnter': (My preferred way)
24+
```
25+
use {
26+
"zbirenbaum/copilot.lua",
27+
event = "InsertEnter",
28+
config = function ()
29+
vim.schedule(function() require("copilot") end)
30+
end,
31+
},
32+
```
33+
2. Load After Statusline + defer:
34+
```
35+
["zbirenbaum/copilot.lua"] = {
36+
"zbirenbaum/copilot.lua",
37+
after = 'feline.nvim', --whichever statusline plugin you use here
38+
config = function ()
39+
vim.defer_fn(function() require("copilot") end, 100)
40+
end,
41+
},
42+
```
43+
44+

0 commit comments

Comments
 (0)