一、样例
/*
* @Author: William Zhang
* @Date: 2021-08-24 23:04:04
* @Last Modified by: William Zhang
* @Last Modified time: 2021-08-24 23:04:04
*/
#include <stdio.h>
int main(int argc, char const *argv[])
{
printf("hello world!");
return 0;
}
二、实现方法
- 搜索扩展
vscode-fileheader
并安装
- 进入设置 - 扩展 - File Header Configuration
3.修改如下两项为自己的信息
- 在代码文件中按
ctrl + alt + i
即可在光标处插入作者信息
三、默认 ctrl + alt + i 快捷键无效解决办法
原因是存在快捷键冲突
到设置 - 键盘快捷方式,搜索框中输入 ctrl + alt + i
,可找到冲突的命令,
修改File Header命令的快捷键组合即可
最后
类似的插件有很多,比如KoroFileHeader
等