Vim:自动完成菜单项颜色

3
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

所有菜单项的颜色都相同。

+1 那肯定很棒,但我不知道怎么做。 - Michael Berkowski
相关:https://vi.stackexchange.com/questions/28561/how-to-use-colored-icons-for-autocomplete-menu-nvim-coc - user10706046
1个回答

0

我通常会参考jellybeans的内容,因为它非常全面(并且作者对于合并请求也非常接纳)。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接