Skip to content

Commit 5c01bad

Browse files
github-actions[bot]AntoineGS
authored andcommitted
docs: update vimdocs
1 parent 2a37f6d commit 5c01bad

File tree

1 file changed

+65
-5
lines changed

1 file changed

+65
-5
lines changed

doc/copilot.txt

Lines changed: 65 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ TABLE OF CONTENTS *copilot-copilot.lua-table-of-contents*
2626
- |copilot-setup-and-configuration|
2727
- |copilot-panel|
2828
- |copilot-suggestion|
29+
- |copilot-highlight-groups|
2930
- |copilot-filetypes|
3031
- |copilot-logger|
3132
- |copilot-copilot_node_command|
@@ -82,6 +83,31 @@ Set either the environment variable `GITHUB_COPILOT_TOKEN` or
8283
`GH_COPILOT_TOKEN` to that token. Note that if you have the variable set, even
8384
empty, the LSP will attempt to use it to log in.
8485

86+
Sign out / Switch accounts ~
87+
88+
To sign out of your current GitHub account:
89+
90+
>
91+
:Copilot auth signout
92+
<
93+
94+
To sign in with a different account:
95+
96+
>
97+
:Copilot auth signin
98+
<
99+
100+
To view your current authentication token information:
101+
102+
>
103+
:Copilot auth info
104+
<
105+
106+
Credentials are stored in: - **Linux/macOS:**
107+
`~/.config/github-copilot/apps.json` (or
108+
`$XDG_CONFIG_HOME/github-copilot/apps.json`) - **Windows:**
109+
`~/AppData/Local/github-copilot/apps.json`
110+
85111

86112
AUTHENTICATION WITH ALTERNATE GITHUB INSTANCES
87113

@@ -283,6 +309,34 @@ These can also be accessed through the `:Copilot suggestion <function>` command
283309
(eg. `:Copilot suggestion accept`).
284310

285311

312+
HIGHLIGHT GROUPS ~
313+
314+
Copilot uses two highlight groups to style its suggestions:
315+
316+
-----------------------------------------------------------------------
317+
Highlight Group Used For Default Link
318+
----------------------- ----------------------- -----------------------
319+
CopilotSuggestion Inline ghost text Comment
320+
suggestions
321+
322+
CopilotAnnotation Annotations in the Comment
323+
panel and inline
324+
suggestions
325+
-----------------------------------------------------------------------
326+
If these highlight groups are not defined by your colorscheme, they will
327+
default to linking to `Comment`. To customize them, set the highlights
328+
**after** your colorscheme loads, or use a `ColorScheme` autocmd:
329+
330+
>lua
331+
vim.api.nvim_create_autocmd("ColorScheme", {
332+
callback = function()
333+
vim.api.nvim_set_hl(0, "CopilotSuggestion", { fg = "#83a598", italic = true })
334+
vim.api.nvim_set_hl(0, "CopilotAnnotation", { fg = "#83a598" })
335+
end,
336+
})
337+
<
338+
339+
286340
NES (NEXT EDIT SUGGESTION) ~
287341

288342

@@ -414,12 +468,13 @@ Example:
414468

415469
SERVER_OPTS_OVERRIDES ~
416470

417-
Override copilot lsp client settings. The `settings` field is where you can set
418-
the values of the options defined in SettingsOpts.md <./SettingsOpts.md>. These
419-
options are specific to the copilot lsp and can be used to customize its
420-
behavior. Ensure that the name field is not overridden as is is used for
471+
Override copilot lsp client settings. See |vim.lsp.start| for the list of
472+
options. Ensure that the `name` field is not overridden as it is used for
421473
efficiency reasons in numerous checks to verify copilot is actually running.
422-
See |vim.lsp.start| for list of options.
474+
475+
The `settings` field is where you can customize the copilot lsp behavior. See
476+
SettingsOpts.md <./SettingsOpts.md> for the full list of available settings and
477+
their keys.
423478

424479
Example:
425480

@@ -438,6 +493,11 @@ Example:
438493
<
439494

440495

496+
[!NOTE] The `settings` values follow a nested table structure matching the keys
497+
in SettingsOpts.md <./SettingsOpts.md>. For example, `InlineSuggestCount:
498+
["advanced", "inlineSuggestCount"]` becomes `settings = { advanced = {
499+
inlineSuggestCount = 3 } }`.
500+
441501
WORKSPACE_FOLDERS ~
442502

443503
Workspace folders improve Copilot’s suggestions. By default, the root_dir is

0 commit comments

Comments
 (0)