|
10 | 10 |
|
11 | 11 | <p> |
12 | 12 | Note that almost everything in this chapter will likely be out of date almost immediately. |
13 | | - The current suggestions here are up to date as of <strong>2025-01-08</strong>. |
| 13 | + The current suggestions here are up to date as of <alert>2025-01-08</alert>. |
14 | 14 | </p> |
15 | 15 | </introduction> |
16 | 16 |
|
|
116 | 116 | <ul> |
117 | 117 | <li> |
118 | 118 | <p> |
119 | | - Suppose you are trying to write some code in a language you are not that familiar with. Copilot will suggest the next bit of code for you as you type. To get better suggestions, put in a comment describing what you want to do. (Hint: if you don't know the syntax for comments, hit <c>CTRL+/</c> to start a comment in most languages.) |
| 119 | + Suppose you are trying to write some code in a language you are not that familiar with. |
| 120 | + Copilot will suggest the next bit of code for you as you type. |
| 121 | + To get better suggestions, put in a comment describing what you want to do. |
| 122 | + (Hint: if you don't know the syntax for comments, hit <c>CTRL+/</c> to start a comment in most languages.) |
120 | 123 | </p> |
121 | 124 | </li> |
| 125 | + |
122 | 126 | <li> |
123 | 127 | <p> |
124 | | - Does the code do what you want it to? Is it confusing? Ask Copilot to <em>explain</em> the code to you. You can select the code, hit <c>CTRL+I</c>, and then type <c>/explain</c> (note the forward slash). |
| 128 | + Does the code do what you want it to? Is it confusing? Ask Copilot to <em>explain</em> the code to you. |
| 129 | + You can select the code, hit <c>CTRL+I</c>, and then type <c>/explain</c> (note the forward slash). |
125 | 130 | </p> |
126 | 131 | </li> |
| 132 | + |
127 | 133 | <li> |
128 | 134 | <p> |
129 | | - Along these lines, try asking Copilot to document your code for you. Select the code, hit <c>CTRL+I</c>, and then type <c>/doc</c>. |
| 135 | + Along these lines, try asking Copilot to document your code for you. |
| 136 | + Select the code, hit <c>CTRL+I</c>, and then type <c>/doc</c>. |
130 | 137 | </p> |
131 | 138 | </li> |
| 139 | + |
132 | 140 | <li> |
133 | 141 | <p> |
134 | | - Here is something I just did while writing this. I realized that I wanted all the keyboard shortcuts to be displayed as code, which in <pretext /> is done by enclosing them in <tag>c</tag> tags. So I selected the entire document, hit <c>CTRL+I</c> and typed <q>wrap all keyboard shortcuts here with <tag>c</tag> tags.</q> Copilot then let me see where it made changes (line by line) and let me accept them or not. |
| 142 | + Here is something I just did while writing this. |
| 143 | + I realized that I wanted all the keyboard shortcuts to be displayed as code, which in <pretext /> is done by enclosing them in <tag>c</tag> tags. |
| 144 | + So I selected the entire document, hit <c>CTRL+I</c> and typed <q>wrap all keyboard shortcuts here with <tag>c</tag> tags.</q> Copilot then let me see where it made changes (line by line) and let me accept them or not. |
135 | 145 | </p> |
| 146 | + |
136 | 147 | <p> |
137 | | - A very new Copilot feature is <term>Copilot Edits</term>, which allow you to do such things for multiple files at the same time. I suspect this could also be useful for finding typos. |
| 148 | + A very new Copilot feature is <term>Copilot Edits</term>, which allow you to do such things for multiple files at the same time. |
| 149 | + I suspect this could also be useful for finding typos. |
138 | 150 | </p> |
139 | 151 | </li> |
| 152 | + |
140 | 153 | <li> |
141 | | - <p> |
142 | | - If you are working on a mathematical proof or a complex equation, you can ask Copilot to help you format it correctly in LaTeX. Simply type your equation or proof in plain text, select it, hit <c>CTRL+I</c>, and ask Copilot to convert it to LaTeX. This can save you a lot of time and ensure that your mathematical notation is accurate. |
143 | | - </p> |
144 | | - <p> |
145 | | - NOTE: I don't know if that's true, the above paragraph was generated by Copilot from the prompt <q>Write a suggestion of something Copilot can do for a mathematician.</q> |
146 | | - </p> |
| 154 | + <p> |
| 155 | + If you are working on a mathematical proof or a complex equation, you can ask Copilot to help you format it correctly in LaTeX. |
| 156 | + Simply type your equation or proof in plain text, select it, hit <c>CTRL+I</c>, and ask Copilot to convert it to LaTeX. |
| 157 | + This can save you a lot of time and ensure that your mathematical notation is accurate. |
| 158 | + </p> |
| 159 | + |
| 160 | + <p> |
| 161 | + NOTE: I don't know if that's true, the above paragraph was generated by Copilot from the prompt <q>Write a suggestion of something Copilot can do for a mathematician.</q> |
| 162 | + </p> |
147 | 163 | </li> |
148 | 164 | </ul> |
149 | 165 | </p> |
150 | | - </section> |
| 166 | + |
| 167 | + <p> |
| 168 | + One final thing you might want to try: <alert>Turn off completions</alert>. |
| 169 | + It can be distracting to see what Copilot thinks you should type next; I have found that it often interrupts the idea I have in my head. |
| 170 | + You can turn off completions by clicking the Copilot icon at the bottom of the VS Code window and selecting <q>Disable completions.</q> You can also disable completions for particular types of files. |
| 171 | + </p> |
| 172 | +</section> |
151 | 173 | </chapter> |
0 commit comments