配置C语言新建文件的默认代码
参考文章https://zhuanlan.zhihu.com/p/100504877
一、找到配置文件
文件-首选项-配置用户代码
File-Preferences-User Snippets

在搜索框输入c
根据需要选择对应配置文件(.json结尾)
c.json是C语言的配置文件(绿色荧光笔标注)
cpp(c++)是c++的配置文件(红色荧光笔标注)
此处以C语言为例,点击c.json
第一次搜索如果没找到c.json显示有一个显示c的文件也是同一文件

二、修改文件
打开之后的样子
{
// Place your snippets for c here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids
本文指导如何在VSCode中配置C语言新建文件时的默认代码模板。步骤包括通过菜单找到用户代码片段配置文件,然后编辑JSON格式的模板,定义触发前缀如"log",并设置代码主体,利用$1,$0等占位符控制编辑位置。"
117053946,10548989,DMX512协议C语言实现调光程序解析,"['C语言编程', 'DMX512协议', '控制系统', '数字接口', 'LED照明']
最低0.47元/天 解锁文章
853

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



