简介
Todo Tree是vscode中一款可以在侧边栏记录TODO注释(也可以配置其他的注释)并且可以高亮注释行的很优秀的插件,现在介绍一下它的一些配置,以下是我的vscode中的配置(Ctrl+Shift+P然后输入setting找到setting.json):
// Todo Tree plugin config
"todo-tree.highlights.defaultHighlight": {
"type": "text",
"foreground": "#ffff00",
"background": "#aaa",
"opacity": 0.5,
"iconColour": "#ffff00",
"gutterIcon": true
},
"todo-tree.highlights.customHighlight": {
"TODO": {
"icon": "check",
"type": "line"
},
"FIXME": {
"foreground": "#ff0000",
"iconColour": "#ff0000",
}
}
效果如图:
常用配置项
foreground 前景色
background 背景色
opacity 背景透明度
iconColour 图标颜色
gutterIcon 是否在编辑器沟槽中显示图标
icon 图标样式(图标样式可在https://primer.style/octicons/或者https://microsoft.github.io/vscode-codicons/dist/codicon.html中找到代码)
type 高亮的模式
- tag 只会高亮标签(比如只高亮TODO)
- text 高亮标签以及所有跟在标签后的文本
- tag-and-comment 高亮标签和前面的注释符
- line 高亮一整行
- whole-line 高亮注释所在的一整行(不管后面还有没有文本)
- none 不高亮