GitHub Copilot:03 又6个技巧提升你人工智能编程效率
前言
之前的文章介绍了 copilot 注册激活,和7个有用的技巧。
今天这篇文章介绍了使用 Github Copilot 的又六个技巧,包括写注释、自动填词、写 list 序列、写翻译、优化配置和修改快捷键。每个技巧都有详细的说明和示例,适合初学者和有经验的开发人员。
步骤
第1个:写注释
写上 ///
符号
![image-20230411055628173](https://ducafecat.oss-cn-beijing.aliyuncs.com/podcast/2023/04/3d645046b4899503456cfc1204257437.png)
换行自动提示参数
![image-20230411055736120](https://ducafecat.oss-cn-beijing.aliyuncs.com/podcast/2023/04/96cb6fa680aa0664e33d0ce088d0774a.png)
第2个:自动填词
帮你水文字
![image-20230411060025246](https://ducafecat.oss-cn-beijing.aliyuncs.com/podcast/2023/04/033af00150995d331b662b7ea30d78e0.png)
帮你写概要
![image-20230411063631751](https://ducafecat.oss-cn-beijing.aliyuncs.com/podcast/2023/04/8544ecfff84877dcf0b8a379ba923392.png)
帮你写小结
![image-20230411063734147](https://ducafecat.oss-cn-beijing.aliyuncs.com/podcast/2023/04/42974a65b62667539e880cc84c0048c5.png)
第3个:写 list 序列
如果你的序列有规则,自动给你填上了。
![image-20230411081404544](https://ducafecat.oss-cn-beijing.aliyuncs.com/podcast/2023/04/45a862ab65ad2e1a8e60d4c7d2a384e0.png)
第4个:写翻译
格式
english: xxxxxxxxxxxxxx
chinese:
输出
![image-20230411100023677](https://ducafecat.oss-cn-beijing.aliyuncs.com/podcast/2023/04/e6b4f1606ee5ff8497de86957172fff6.png)
第5个:优化你的配置
配置项
ID | 说明 | 默认值 |
---|---|---|
github.copilot.advanced | 推荐参数设置 | [object Object] |
github.copilot.enable | 屏蔽编程语言 [languages](vscode-file://vscode-app/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html) | [object Object] |
github.copilot.inlineSuggest.enable | 显示内联建议 | true |
我的配置
// copilot
"github.copilot.inlineSuggest.enable": true,
"editor.suggest.preview": true,
"editor.inlineSuggest.enabled": true,
"editor.inlineSuggest.showToolbar": "always",
"github.copilot.enable": {
"*": true,
"yaml": false,
"plaintext": false,
"scminput": false,
"markdown": true,
"javascript": true,
"python": true
},
"github.copilot.advanced": {
"inlineSuggestCount": 3
}
key | 说明 |
---|---|
github.copilot.inlineSuggest.enable | 是否开启内联提示 |
editor.suggest.preview | 编辑器提示预览 |
editor.inlineSuggest.enabled | 编辑器内联提示 |
editor.inlineSuggest.showToolbar | 显示提示工具栏 |
github.copilot.enable | 语言开关 |
github.copilot.advanced | 高级设置 |
第6个:修改快捷键
常用的提词、切换都可以设置成自己习惯的按键.
![image-20230411105104444](https://ducafecat.oss-cn-beijing.aliyuncs.com/podcast/2023/04/8b52e3d2117e54df09445925ffa94c1f.png)
搜索 github copilot
![image-20230411105152522](https://ducafecat.oss-cn-beijing.aliyuncs.com/podcast/2023/04/15d1071646e8c7aa591f0b19b4f2e83c.png)
注意右侧的源类型 Github Copilot
小结
本文介绍了使用 Github Copilot 的六个技巧,包括写注释、自动填词、写 list 序列、写翻译、优化配置和修改快捷键。总的来说,使用 Github Copilot 可以极大地提高开发效率,但也需要注意一些细节,如理解用户需求、规范注释、合理配置等。希望这些技巧能够帮助你更好地使用 Github Copilot。
end