Skip to content

Commit 2a37f6d

Browse files
committed
chore: update README
Fixes #610, #651, #201 Mostly written by Claude
1 parent dd3e345 commit 2a37f6d

1 file changed

Lines changed: 56 additions & 3 deletions

File tree

README.md

Lines changed: 56 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ As lua is far more efficient and makes things easier to integrate with modern pl
2323
- [Setup and Configuration](#setup-and-configuration)
2424
- [panel](#panel)
2525
- [suggestion](#suggestion)
26+
- [Highlight Groups](#highlight-groups)
2627
- [filetypes](#filetypes)
2728
- [logger](#logger)
2829
- [copilot_node_command](#copilot_node_command)
@@ -81,6 +82,33 @@ Note that if you have the variable set, even empty, the LSP will attempt to use
8182

8283
</details>
8384

85+
<details>
86+
<summary>Sign out / Switch accounts</summary>
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:
107+
- **Linux/macOS:** `~/.config/github-copilot/apps.json` (or `$XDG_CONFIG_HOME/github-copilot/apps.json`)
108+
- **Windows:** `~/AppData/Local/github-copilot/apps.json`
109+
110+
</details>
111+
84112
#### Authentication with Alternate GitHub Instances
85113

86114
If your access to Copilot is not provided by the public GitHub instance, you can set your
@@ -279,6 +307,26 @@ require("copilot.suggestion").toggle_auto_trigger()
279307
```
280308
These can also be accessed through the `:Copilot suggestion <function>` command (eg. `:Copilot suggestion accept`).
281309

310+
### Highlight Groups
311+
312+
Copilot uses two highlight groups to style its suggestions:
313+
314+
| Highlight Group | Used For | Default Link |
315+
|---|---|---|
316+
| `CopilotSuggestion` | Inline ghost text suggestions | `Comment` |
317+
| `CopilotAnnotation` | Annotations in the panel and inline suggestions | `Comment` |
318+
319+
If these highlight groups are not defined by your colorscheme, they will default to linking to `Comment`. To customize them, set the highlights **after** your colorscheme loads, or use a `ColorScheme` autocmd:
320+
321+
```lua
322+
vim.api.nvim_create_autocmd("ColorScheme", {
323+
callback = function()
324+
vim.api.nvim_set_hl(0, "CopilotSuggestion", { fg = "#83a598", italic = true })
325+
vim.api.nvim_set_hl(0, "CopilotAnnotation", { fg = "#83a598" })
326+
end,
327+
})
328+
```
329+
282330
### nes (next edit suggestion)
283331

284332
>[!WARNING]
@@ -395,9 +443,10 @@ copilot_node_command = vim.fn.expand("$HOME") .. "/.config/nvm/versions/node/v22
395443

396444
### server_opts_overrides
397445

398-
Override copilot lsp client settings. The `settings` field is where you can set the values of the options defined in [SettingsOpts.md](./SettingsOpts.md).
399-
These options are specific to the copilot lsp and can be used to customize its behavior. Ensure that the name field is not overridden as is is used for
400-
efficiency reasons in numerous checks to verify copilot is actually running. See `:h vim.lsp.start` for list of options.
446+
Override copilot lsp client settings. See `:h vim.lsp.start` for the list of options.
447+
Ensure that the `name` field is not overridden as it is used for efficiency reasons in numerous checks to verify copilot is actually running.
448+
449+
The `settings` field is where you can customize the copilot lsp behavior. See [SettingsOpts.md](./SettingsOpts.md) for the full list of available settings and their keys.
401450

402451
Example:
403452

@@ -415,6 +464,10 @@ require("copilot").setup {
415464
}
416465
```
417466

467+
> [!NOTE]
468+
> The `settings` values follow a nested table structure matching the keys in [SettingsOpts.md](./SettingsOpts.md).
469+
> For example, `InlineSuggestCount: ["advanced", "inlineSuggestCount"]` becomes `settings = { advanced = { inlineSuggestCount = 3 } }`.
470+
418471
### workspace_folders
419472

420473
Workspace folders improve Copilot's suggestions.

0 commit comments

Comments
 (0)