vscode配置header指令添加头部注释或KoroFileHeader自动添加头部解释

2023-03-07 14:22:27 浏览数 (1)

1.
(1)新建Python文件输入header添加头部注释

vscode -> file -> Perferences -> User Snippets ->python(也可选其他语言) :则会生成python.json文件,如下在{}内添加json

代码语言:javascript复制
	"HEADER": {
	  "prefix": "header",
	  "body": [
		"# -*- encoding: utf-8 -*-",	
		"'''",
		"file       :$TM_FILENAME",
		"Description:",
		"Date       :$CURRENT_YEAR/$CURRENT_MONTH/$CURRENT_DATE $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND",
		"Author     :Xu xx",
		"version    :python3.7.8",
		"'''",
		"",
		"$0"
	  ],
	}
(2)保存json文件,重启vscode,创建文件,敲header选中(可能是提示出现的第二个header)
2. vscode安装KoroFileHeader插件配置参数

可参考如下文章: 1.https://github.com/OBKoro1/koro1FileHeader/wiki/配置 2.https://blog.csdn.net/qq_42306443/article/details/96423676?utm_medium=distribute.pc_relevant.none-task-blog-baidujs-1

0 人点赞