Vim的自动补全功能包括区分不同类型的选项。我现在正在编写自己的自动补全。因此,我想用不同的颜色为每种类型的条目着色。正如Vim文档中所述,这应该是可能的:
所有菜单项的颜色都相同。
The "kind" item uses a single letter to indicate the kind of completion. This may be used to show the completion differently (different color or icon). Currently these types can be used:
v variable f function or method m member of a struct or class t typedef d #define or macro
这可以用来以不同的方式显示完成状态(不同的颜色或图标)。怎么做?
我在Vim帮助中没有找到任何内容。菜单的高亮设置(hl-PMenu)似乎只适用于整个菜单,而不是不同类型。
目前,完成状态如下所示(后面的字母表示类型):
variable1 v
str() f
所有菜单项的颜色都相同。