实现效果

实现代码
- 在VS Code 中,点击"文件" -> "首选项" -> "用户代码片段"。
- 在弹出的窗口中,选择"c" 作为语言;
- 在右侧的编辑器中,会显示一个JSON 格式的代码片段模板,复制下面的C 模板代码。
"New c file": {
"prefix": "newfile",
"body": [
"/*",
"* ${1:${TM_FILENAME/(.*)\\.C$/${1:/downcase}.c/i}}",
"*",
"* Created on: ${CURRENT_YEAR/(.*)/${1:/upcase}/}.${CURRENT_MONTH/(.*)/${1:/upcase}/}.${CURRENT_DATE/(.*)/${1:/upcase}/}",
"* Author: ========",
"*/\n\n",
],
"description": "A new file template"
},
"New .h header": {
"prefix": "newh",
"body": [
"#ifndef ${1:${TM_FILENAME/(.*)\\.C$/${1:/upcase}_H/i}} \n#define $1 \n",
"#ifdef __cplusplus \nextern \"C\"{\n#endif \n\n\n\n\n#ifdef __cplusplus\n}\n#endif /* extern \"C\" */ \n",
"#endif\t// $1"
],
"description": "A c .h file template"
},


7390

被折叠的 条评论
为什么被折叠?



