Skip to content

Commit af3114a

Browse files
github-actions[bot]AntoineGS
authored andcommitted
docs: update vimdocs
1 parent 2ac3ab3 commit af3114a

File tree

1 file changed

+67
-12
lines changed

1 file changed

+67
-12
lines changed

doc/copilot.txt

Lines changed: 67 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
1. copilot.lua *copilot-copilot.lua*
55

66
This plugin is the pure lua replacement for github/copilot.vim
7-
<https://github.com/github/copilot.vim>.
7+
<https://github.com/github/copilot.vim>. A huge thank you to @tris203 for the
8+
code behind the nes functionality (copilot-lsp
9+
<https://github.com/copilotlsp-nvim/copilot-lsp>).
810

911
Motivation behind `copilot.lua` ~
1012

@@ -50,7 +52,11 @@ Install the plugin with your preferred plugin manager. For example, with
5052
packer.nvim <https://github.com/wbthomason/packer.nvim>:
5153

5254
>lua
53-
use { "zbirenbaum/copilot.lua" }
55+
use { "zbirenbaum/copilot.lua"
56+
requires = {
57+
"copilotlsp-nvim/copilot-lsp", -- (optional) for NES functionality
58+
},
59+
}
5460
<
5561

5662

@@ -95,6 +101,9 @@ you lazy load copilot. For example:
95101
>lua
96102
use {
97103
"zbirenbaum/copilot.lua",
104+
requires = {
105+
"copilotlsp-nvim/copilot-lsp", -- (optional) for NES functionality
106+
},
98107
cmd = "Copilot",
99108
event = "InsertEnter",
100109
config = function()
@@ -137,16 +146,14 @@ Default configuration ~
137146
dismiss = "<C-]>",
138147
},
139148
},
140-
filetypes = {
141-
yaml = false,
142-
markdown = false,
143-
help = false,
144-
gitcommit = false,
145-
gitrebase = false,
146-
hgcommit = false,
147-
svn = false,
148-
cvs = false,
149-
["."] = false,
149+
nes = {
150+
enabled = false, -- requires copilot-lsp as a dependency
151+
auto_trigger = false,
152+
keymap = {
153+
accept_and_goto = false,
154+
accept = false,
155+
dismiss = false,
156+
},
150157
},
151158
auth_provider_url = nil, -- URL to authentication provider, if not "https://github.com/"
152159
logger = {
@@ -273,6 +280,49 @@ These can also be accessed through the `:Copilot suggestion <function>` command
273280
(eg. `:Copilot suggestion accept`).
274281

275282

283+
NES (NEXT EDIT SUGGESTION) ~
284+
285+
286+
[!WARNING] This feature is still experimental and may not work as expected in
287+
all scenarios, please report any issues you encounter.
288+
When `enabled` is `true`, copilot will provide suggestions based on the next
289+
edit you are likely to make, through copilot-lsp
290+
<https://github.com/copilotlsp-nvim/copilot-lsp>. If there is no suggestion,
291+
the keymaps will pass through the original keymap.
292+
293+
`copilot-lsp` has a few configurations built-in as well, for additional
294+
configurations, please refer to the copilot-lsp documentation
295+
<https://github.com/copilotlsp-nvim/copilot-lsp/blob/main/README.md>. These
296+
configurations should be set in the `init` function of the `copilot-lsp`
297+
dependency.
298+
299+
>lua
300+
use {
301+
"zbirenbaum/copilot.lua",
302+
requires = {
303+
"copilotlsp-nvim/copilot-lsp",
304+
init = function()
305+
vim.g.copilot_nes_debounce = 500
306+
end,
307+
},
308+
cmd = "Copilot",
309+
event = "InsertEnter",
310+
config = function()
311+
require("copilot").setup({
312+
nes = {
313+
enabled = true,
314+
keymap = {
315+
accept_and_goto = "<leader>p",
316+
accept = false,
317+
dismiss = "<Esc>",
318+
},
319+
},
320+
})
321+
end,
322+
}
323+
<
324+
325+
276326
FILETYPES ~
277327

278328
Specify filetypes for attaching copilot.
@@ -508,6 +558,11 @@ Set the same for copilot in `server_opts_overrides`:
508558

509559
Refer to your plugins documentation for changes.
510560

561+
==============================================================================
562+
2. Links *copilot-links*
563+
564+
1. *@tris203*:
565+
511566
Generated by panvimdoc <https://github.com/kdheepak/panvimdoc>
512567

513568
vim:tw=78:ts=8:noet:ft=help:norl:

0 commit comments

Comments
 (0)