像VOD这样的一些词语总是在VIM中突出显示。
我可以在此列表中添加一些我想要突出显示的自定义单词吗?
A few words such as TODO remain highlighted always in VIM.
Can I add some custom words to this list which I want to be highlighted always?
最满意答案
Todo是一个语法组 , :h group-name来检查详细信息。
如果要突出显示某些单词/文本,可以编辑语法文件,也可以创建自己的hi-groups ( :h highlight-groups )并添加匹配项。
例如:
你可以match todo /!Important!/让文字!Important! 以与TODO相同的方式突出显示。 要么:
hi! Important ctermbg=red guibg=red这将创建一个名为Important的hi组。
然后你添加匹配:
:match Important /!Important!/这将突出显示文字!Important! 以您在组中定义的方式。
您还可以在vimrc中添加这些行。
Todo is a syntax group, :h group-name to check detail.
If you want to make some words/text highlighted, you can either edit syntax file, or create your own hi-groups (:h highlight-groups) and add match.
For example:
You can do match todo /!Important!/ to let text !Important! to be highlighted in same way as TODO. Or:
hi! Important ctermbg=red guibg=redthis will create a hi-group called Important.
Then you add match:
:match Important /!Important!/this will highlight text !Important! in the way you defined in the group.
You could also add those lines in your vimrc.
更多推荐
发布评论