@@ -11,12 +11,13 @@ Table of Contents *CopilotChat-table-of-contents*
1111 - lazy.nvim | CopilotChat-lazy.nvim |
1212 - vim-plug | CopilotChat-vim-plug |
13132. Core Concepts | CopilotChat-core-concepts |
14- - Examples | CopilotChat-examples |
15143. Usage | CopilotChat-usage |
1615 - Commands | CopilotChat-commands |
1716 - Chat Key Mappings | CopilotChat-chat-key-mappings |
1817 - Predefined Functions | CopilotChat-predefined-functions |
1918 - Predefined Prompts | CopilotChat-predefined-prompts |
19+ - Resource Usage | CopilotChat-resource-usage |
20+ - Tool Usage | CopilotChat-tool-usage |
20214. Configuration | CopilotChat-configuration |
2122 - Quick Setup | CopilotChat-quick-setup |
2223 - Window & Appearance | CopilotChat-window-&-appearance |
@@ -132,34 +133,8 @@ VIM-PLUG *CopilotChat-vim-plug*
132133- **Prompts** (`/PromptName` ) - Use predefined prompt templates for common tasks
133134
134135
135- EXAMPLES *CopilotChat-examples*
136-
137- >markdown
138- # Add specific file to context
139-
140- #file:src/main.lua
141-
142- # Give LLM access to workspace tools
143-
144- @copilot What files are in this project?
145-
146- # Sticky prompt that persists
147-
148- > #buffer:active
149- > You are a helpful coding assistant
150- <
151-
152- When you use `@c opilot` , the LLM can call functions from the `copilot` group
153- such as `bash` , `edit ` , `file ` , `glob ` , `grep ` , and `gitdiff` .
154-
155- - By default, proposed tool calls wait for your approval.
156- - You can configure `trusted_tools` to automatically run specific tools or groups.
157- - Resources added with `#... ` are resolved immediately and shared as context.
158- - Tool call results are sent back to the model as plain output, while manual resources keep their `##<uri> ` references in chat.
159-
160-
161- [!WARNING ] `trusted_tools = true` allows the model to run every enabled tool
162- without asking. Only use it if you fully trust the tool set and workspace.
136+ [!TIP] Press `<Tab> ` after typing `#` or `@ ` to see available options and
137+ auto-complete. This is the easiest way to discover what’s available!
163138
164139==============================================================================
1651403. Usage *CopilotChat-usage*
@@ -183,72 +158,89 @@ COMMANDS *CopilotChat-commands*
183158
184159CHAT KEY MAPPINGS *CopilotChat-chat-key-mappings*
185160
161+ -------------------------------------------------------------------------
186162 Insert Normal Action
187- -------- -------- -------------------------------------------
188- <Tab> - Trigger/accept completion menu for tokens
163+ -------- -------- -------------------------------------------------------
164+ <Tab> - Autocomplete resources/files/options (use this!)
165+
189166 <C-c> q Close the chat window
167+
190168 <C-l> <C-l> Reset and clear the chat window
169+
191170 <C-s> <CR> Submit the current prompt
171+
192172 <C-y> <C-y> Accept nearest diff
173+
193174 - gj Jump to section of nearest diff
175+
194176 - gqa Add all answers from chat to quickfix
177+
195178 - gqd Add all diffs from chat to quickfix
179+
196180 - gy Yank nearest diff to register
181+
197182 - gd Show diff between source and nearest diff
183+
198184 - gc Show info about current chat
185+
199186 - gh Show help message
187+ -------------------------------------------------------------------------
188+ **💡 Pro tip:** After typing `#` , `@ ` , `#buffer :` , or `#file :` , press `<Tab> `
189+ to see available options. This is the fastest way to work!
190+
200191
201- [!WARNING ] Some plugins (e.g. `copilot.vim ` ) may also map common keys like
202- `<Tab> ` in insert mode. To avoid conflicts, disable Copilot’s default `<Tab> `
203- mapping with :
192+ [!NOTE] **Tab key not working?** Some plugins (e.g. `copilot.vim ` ) also map
193+ `<Tab> ` in insert mode. To fix conflicts, disable the other plugin’s `<Tab> `
194+ mapping:
204195 >lua
196+ -- For copilot.vim
205197 vim.g.copilot_no_tab_map = true
206198 vim.keymap.set('i', '<S-Tab> ', 'copilot#Accept("\\<S-Tab> ")', { expr = true, replace_keycodes = false })
207199 <
208- You can also customize CopilotChat keymaps in your config.
200+ Or customize CopilotChat keymaps in your config.
209201
210202PREDEFINED FUNCTIONS *CopilotChat-predefined-functions*
211203
212204All predefined functions belong to the `copilot` group.
213205
214- ----------------------------------------------------------------------------------
215- Function Manual Description Example Usage
216- #...
217- ----------- --------- --------------------------------------- --------------------
218- bash No Executes a bash command and returns @copilot
219- output
220-
221- buffer Yes Retrieves content from buffer(s) with #buffer:active
222- diagnostics
223-
224- clipboard Yes Provides access to system clipboard #clipboard
225- content
206+ ---------------------------------------------------------------------------------
207+ Function Manual Description Available Options
208+ #...
209+ ----------- -------- -------------------------- ---------------------------------
210+ bash No Executes a bash command Tool-only (use @copilot)
211+ and returns output
226212
227- edit No Applies a unified diff to a file @copilot
213+ buffer Yes Retrieves content from active, visible, listed,
214+ buffer(s) with diagnostics quickfix, buffer number, or
215+ filename
228216
229- file Yes Reads content from a specified file # file:path/to/file
230- path
217+ clipboard Yes Provides access to system No options
218+ clipboard content
231219
232- gitdiff Yes Retrieves git diff information #gitdiff:staged
220+ edit No Applies a unified diff to Tool-only (use @copilot)
221+ a file
233222
234- glob Yes Lists filenames matching a pattern in #glob:**/*.lua
235- workspace
223+ file Yes Reads content from a Any file path (use <Tab> for
224+ specified file path completion)
236225
237- grep Yes Searches for a pattern across files in #grep:TODO
238- workspace
226+ gitdiff Yes Retrieves git diff unstaged (default), staged, or
227+ information commit SHA
239228
240- selection Yes Includes the current visual selection #selection
241- with diagnostics
229+ glob Yes Lists filenames matching a Any glob pattern (default: **/*)
230+ pattern in workspace
242231
243- url Yes Fetches content from a specified URL #url:https://...
244- ----------------------------------------------------------------------------------
245- `#... ` resolves a function immediately and adds its output as chat context.
232+ grep Yes Searches for a pattern Any search pattern
233+ across files in workspace
246234
247- `@c opilot` shares the enabled functions with the model so it can choose when to
248- call them.
235+ selection Yes Includes the current No options
236+ visual selection with
237+ diagnostics
249238
250- Only `bash` and `edit ` are tool-only. The rest can be used both as manual
251- resources and as callable tools.
239+ url Yes Fetches content from a Any HTTPS URL
240+ specified URL
241+ ---------------------------------------------------------------------------------
242+ - **#<function> ** - Embeds output directly in your message (e.g., `#buffer :listed` , `#file :src /main.lua ` )
243+ - **@<function/group>** - Makes function(s) available for LLM to call when needed (e.g., `@c opilot` , `@f ile` )
252244
253245
254246PREDEFINED PROMPTS *CopilotChat-predefined-prompts*
@@ -272,6 +264,59 @@ PREDEFINED PROMPTS *CopilotChat-predefined-prompts*
272264 changes
273265 -------------------------------------------------------------------------
274266
267+ RESOURCE USAGE *CopilotChat-resource-usage*
268+
269+ >markdown
270+ # Current buffer
271+
272+ #buffer:active
273+
274+ # All open buffers (replaces old #buffers)
275+
276+ #buffer:listed
277+
278+ # All visible buffers
279+
280+ #buffer:visible
281+
282+ # Specific file
283+
284+ #file:src/main.lua
285+
286+ # Git changes
287+
288+ #gitdiff:staged
289+
290+ # URL content
291+
292+ #url:https://example.com/docs
293+ <
294+
295+
296+ TOOL USAGE *CopilotChat-tool-usage*
297+
298+ When you use `@c opilot` , the LLM can call functions from the `copilot` group
299+ such as `bash` , `edit ` , `file ` , `glob ` , `grep ` , and `gitdiff` .
300+
301+ >markdown
302+ # Give LLM access to workspace tools
303+
304+ @copilot What files are in this project?
305+
306+ # Sticky context with tools
307+
308+ > #buffer:listed
309+ > @copilot
310+ > Refactor the authentication code
311+ <
312+
313+ By default, tool calls require manual approval. Configure `trusted_tools` to
314+ automatically run specific tools (see | CopilotChat-functions | ).
315+
316+
317+ [!WARNING ] `trusted_tools = true` allows the model to run every enabled tool
318+ without asking. Only use it if you fully trust the tool set and workspace.
319+
275320==============================================================================
2763214. Configuration *CopilotChat-configuration*
277322
@@ -408,15 +453,17 @@ Use `trusted_tools` to control which tool calls are executed automatically:
408453 }
409454<
410455
456+ **How tool trust works:**
457+
411458A tool is trusted when any of these match:
412459
413460- Its function definition sets `trusted = true`
414461- Its function name appears in `trusted_tools`
415462- Its function group appears in `trusted_tools`
416463- `trusted_tools = true`
417464
418- For most setups, trusting a few read-only functions such as `file ` , `glob ` , or
419- ` grep ` is safer than trusting everything .
465+ **Recommended setup:** Trust read-only functions like `file ` , `glob ` , or ` grep `
466+ for a smoother workflow without compromising safety .
420467
421468
422469 [!WARNING ] Trusted tools run without asking for confirmation. Be especially
@@ -676,7 +723,7 @@ See CONTRIBUTING.md </CONTRIBUTING.md> for detailed guidelines.
676723Thanks goes to these wonderful people (emoji key
677724<https://allcontributors.org/docs/en/emoji-key >):
678725
679- gptlang💻 📖Dung Duc Huynh (Kaka)💻 📖Ahmed Haracic💻Trí Thiện Nguyễn💻He Zhizhou💻Guruprakash Rajakkannu💻kristofka💻PostCyberPunk📖Katsuhiko Nishimra💻Erno Hopearuoho💻Shaun Garwood💻neutrinoA4💻 📖Jack Muratore💻Adriel Velazquez💻 📖Tomas Slusny💻 📖Nisal📖Tobias Gårdhus📖Petr Dlouhý📖Dylan Madisetti💻Aaron Weisberg💻 📖Jose Tlacuilo💻 📖Kevin Traver💻 📖dTry💻Arata Furukawa💻Ling💻Ivan Frolov💻Folke Lemaitre💻 📖GitMurf💻Dmitrii Lipin💻jinzhongjia📖guill💻Sjon-Paul Brown💻Renzo Mondragón💻 📖fjchen7💻Radosław Woźniak💻JakubPecenka💻thomastthai📖Tomáš Janoušek💻Toddneal Stallworth📖Sergey Alexandrov💻Léopold Mebazaa💻JunKi Jin💻abdennourzahaf📖Josiah💻Tony Fischer💻 📖Kohei Wada💻Sebastian Yaghoubi📖johncming💻Rokas Brazdžionis💻Sola📖 💻Mani Chandra💻Nischal Basuti📖Teo Ljungberg💻Joe Price💻Yufan You📖 💻Manish Kumar💻Anton Ždanov📖 💻Fredrik Averpil💻Aaron D Borden💻Md. Iftakhar Awal Chowdhury💻 📖Danilo Horta💻Mihamina Rakotomandimby📖 💻Ajmal S💻Samiul Islam💻Rui Costa💻CTCHEN💻Tobias Wölfel💻Alexander Garcia💻Max Kharandziuk💻Xinyu Xiang💻junqizhang💻Calum Lynch💻sirjls💻This project follows the all-contributors
726+ gptlang💻 📖Dung Duc Huynh (Kaka)💻 📖Ahmed Haracic💻Trí Thiện Nguyễn💻He Zhizhou💻Guruprakash Rajakkannu💻kristofka💻PostCyberPunk📖Katsuhiko Nishimra💻Erno Hopearuoho💻Shaun Garwood💻neutrinoA4💻 📖Jack Muratore💻Adriel Velazquez💻 📖Tomas Slusny💻 📖Nisal📖Tobias Gårdhus📖Petr Dlouhý📖Dylan Madisetti💻Aaron Weisberg💻 📖Jose Tlacuilo💻 📖Kevin Traver💻 📖dTry💻Arata Furukawa💻Ling💻Ivan Frolov💻Folke Lemaitre💻 📖GitMurf💻Dmitrii Lipin💻jinzhongjia📖guill💻Sjon-Paul Brown💻Renzo Mondragón💻 📖fjchen7💻Radosław Woźniak💻JakubPecenka💻thomastthai📖Tomáš Janoušek💻Toddneal Stallworth📖Sergey Alexandrov💻Léopold Mebazaa💻JunKi Jin💻abdennourzahaf📖Josiah💻Tony Fischer💻 📖Kohei Wada💻Sebastian Yaghoubi📖johncming💻Rokas Brazdžionis💻Sola📖 💻Mani Chandra💻Nischal Basuti📖Teo Ljungberg💻Joe Price💻Yufan You📖 💻Manish Kumar💻Anton Ždanov📖 💻Fredrik Averpil💻Aaron D Borden💻Md. Iftakhar Awal Chowdhury💻 📖Danilo Horta💻Mihamina Rakotomandimby📖 💻Ajmal S💻Samiul Islam💻Rui Costa💻CTCHEN💻Tobias Wölfel💻Alexander Garcia💻Max Kharandziuk💻Xinyu Xiang💻junqizhang💻Calum Lynch💻sirjls💻Vladimir Kolchurin💻This project follows the all-contributors
680727<https://github.com/all-contributors/all-contributors > specification.
681728Contributions of any kind are welcome!
682729
0 commit comments