You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/CopilotChat.txt
+55-18Lines changed: 55 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -139,21 +139,54 @@ COMMANDS ~
139
139
- `:CopilotChatAgents` - View and select available agents. This is reset when a new instance is made. Please set your agent in `init.lua` for persistence.
140
140
141
141
142
-
COMMANDS COMING FROM DEFAULT PROMPTS
142
+
PROMPTS~
143
143
144
-
- `:CopilotChatExplain` - Write an explanation for the selected code and diagnostics as paragraphs of text
145
-
- `:CopilotChatReview` - Review the selected code
146
-
- `:CopilotChatFix` - There is a problem in this code. Rewrite the code to show it with the bug fixed
147
-
- `:CopilotChatOptimize` - Optimize the selected code to improve performance and readability
148
-
- `:CopilotChatDocs` - Please add documentation comments to the selected code
149
-
- `:CopilotChatTests` - Please generate tests for my code
150
-
- `:CopilotChatCommit` - Write commit message for the change with commitizen convention
144
+
You can ask Copilot to do various tasks with prompts. You can reference prompts
145
+
with `/PromptName` in chat or call with command `:CopilotChat<PromptName>`.
146
+
Default prompts are:
151
147
148
+
- `Explain` - Write an explanation for the selected code and diagnostics as paragraphs of text
149
+
- `Review` - Review the selected code
150
+
- `Fix` - There is a problem in this code. Rewrite the code to show it with the bug fixed
151
+
- `Optimize` - Optimize the selected code to improve performance and readability
152
+
- `Docs` - Please add documentation comments to the selected code
153
+
- `Tests` - Please generate tests for my code
154
+
- `Commit` - Write commit message for the change with commitizen convention
152
155
153
-
MODELS, AGENTS AND CONTEXTS ~
154
156
157
+
SYSTEM PROMPTS ~
155
158
156
-
MODELS
159
+
System prompts specify the behavior of the AI model. You can reference system
160
+
prompts with `/PROMPT_NAME` in chat. Default system prompts are:
161
+
162
+
- `COPILOT_INSTRUCTIONS` - Base GitHub Copilot instructions
163
+
- `COPILOT_EXPLAIN` - On top of the base instructions adds coding tutor behavior
164
+
- `COPILOT_REVIEW` - On top of the base instructions adds code review behavior with instructions on how to generate diagnostics
165
+
- `COPILOT_GENERATE` - On top of the base instructions adds code generation behavior, with predefined formatting and generation rules
166
+
167
+
168
+
STICKY PROMPTS ~
169
+
170
+
You can set sticky prompt in chat by prefixing the text with `>` using markdown
171
+
blockquote syntax. The sticky prompt will be copied at start of every new
172
+
prompt in chat window. You can freely edit the sticky prompt, only rule is `>`
173
+
prefix at beginning of line. This is useful for preserving stuff like context
174
+
and agent selection (see below). Example usage:
175
+
176
+
>markdown
177
+
> #files
178
+
179
+
List all files in the workspace
180
+
<
181
+
182
+
>markdown
183
+
> @models Using Mistral-small
184
+
185
+
What is 1 + 11
186
+
<
187
+
188
+
189
+
MODELS ~
157
190
158
191
You can list available models with `:CopilotChatModels` command. Model
159
192
determines the AI model used for the chat. Default models are:
@@ -170,7 +203,7 @@ using `@models` agent from here <https://github.com/marketplace/models-github>
170
203
(example: `@models Using Mistral-small, what is 1 + 11`)
171
204
172
205
173
-
AGENTS
206
+
AGENTS~
174
207
175
208
Agents are used to determine the AI agent used for the chat. You can list
176
209
available agents with `:CopilotChatAgents` command. You can set the agent in
@@ -183,7 +216,7 @@ You can install more agents from here
Contexts are used to determine the context of the chat. You can set the context
189
222
in the prompt by using `#` followed by the context name. Supported contexts
@@ -306,25 +339,25 @@ Also see here </lua/CopilotChat/config.lua>:
306
339
-- default prompts
307
340
prompts = {
308
341
Explain = {
309
-
prompt = '/COPILOT_EXPLAIN Write an explanation for the selected code and diagnostics as paragraphs of text.',
342
+
prompt = '> /COPILOT_EXPLAIN\n\nWrite an explanation for the selected code and diagnostics as paragraphs of text.',
310
343
},
311
344
Review = {
312
-
prompt = '/COPILOT_REVIEW Review the selected code.',
345
+
prompt = '> /COPILOT_REVIEW\n\nReview the selected code.',
313
346
callback = function(response, source)
314
347
-- see config.lua for implementation
315
348
end,
316
349
},
317
350
Fix = {
318
-
prompt = '/COPILOT_GENERATE There is a problem in this code. Rewrite the code to show it with the bug fixed.',
351
+
prompt = '> /COPILOT_GENERATE\n\nThere is a problem in this code. Rewrite the code to show it with the bug fixed.',
319
352
},
320
353
Optimize = {
321
-
prompt = '/COPILOT_GENERATE Optimize the selected code to improve performance and readability.',
354
+
prompt = '> /COPILOT_GENERATE\n\nOptimize the selected code to improve performance and readability.',
322
355
},
323
356
Docs = {
324
-
prompt = '/COPILOT_GENERATE Please add documentation comments to the selected code.',
357
+
prompt = '> /COPILOT_GENERATE\n\nPlease add documentation comments to the selected code.',
325
358
},
326
359
Tests = {
327
-
prompt = '/COPILOT_GENERATE Please generate tests for my code.',
360
+
prompt = '> /COPILOT_GENERATE\n\nPlease generate tests for my code.',
328
361
},
329
362
Commit = {
330
363
prompt = 'Write commit message for the change with commitizen convention. Make sure the title has maximum 50 characters and message is wrapped at 72 characters. Wrap the whole message in code block with language gitcommit.',
@@ -365,6 +398,10 @@ Also see here </lua/CopilotChat/config.lua>:
365
398
normal = '<CR>',
366
399
insert = '<C-s>'
367
400
},
401
+
toggle_sticky = {
402
+
detail = 'Makes line under cursor sticky or deletes sticky line.',
0 commit comments