@@ -90,27 +90,30 @@ endfunction
9090" EasyExtra: "‰", 继承 PmenuExtra
9191"
9292" vscode 提供了超过五种 kind 颜色配置,把 lsp 和 text
93- " 区分开,这里增加5种常见的颜色配置:
93+ " 区分开,这里设置6种常见的颜色配置:
94+ " 6种颜色做隔离足够了,ColorScheme 常用颜色一般也就八九个
9495" EasyFunction: "%", Function/Constant/Scruct
9596" EasySnippet: "∫", Snippet/snip
9697" EasyTabNine: "@", TabNine
9798" EasyNormal: "Φ", Buf/Text/dict - Pmenu 默认色
9899" EasyKeyword: "♧", Keyword
100+ " EasyModule: "♤", module
99101function ! s: hl ()
100102 if empty (s: easycomplete_hl_exec_cmd )
101103 if easycomplete#util#IsGui ()
102104 let dev = " gui"
103105 else
104106 let dev = " cterm"
105107 endif
106- let fuzzymatch_hl_group = s: HLExists (" EasyFuzzyMatch" ) ? " EasyFuzzyMatch" : " PmenuMatch"
107- let pmenu_kind_hl_group = s: HLExists (" EasyPmenuKind" ) ? " EasyPmenuKind" : " PmenuKind"
108- let pmenu_extra_hl_group = s: HLExists (" EasyPmenuExtra" ) ? " EasyPmenuExtra" : " PmenuExtra"
109- let function_hl_group = s: HLExists (" EasyFunction" ) ? " EasyFunction" : " Conditional"
110- let snippet_hl_group = s: HLExists (" EasySnippet" ) ? " EasySnippet" : " Keyword"
111- let tabnine_hl_group = s: HLExists (" EasyTabNine" ) ? " EasyTabNine" : " Character"
112- let pmenu_hl_group = s: HLExists (" EasyPmenu" ) ? " EasyPmenu" : " Pmenu"
113- let keyword_hl_group = s: HLExists (" EasyKeyword" ) ? " EasyKeyword" : " Define"
108+ let fuzzymatch_hl_group = s: HLExists (" EasyFuzzyMatch" ) ? " EasyFuzzyMatch" : " PmenuMatch"
109+ let pmenu_kind_hl_group = s: HLExists (" EasyPmenuKind" ) ? " EasyPmenuKind" : " PmenuKind"
110+ let pmenu_extra_hl_group = s: HLExists (" EasyPmenuExtra" ) ? " EasyPmenuExtra" : " PmenuExtra"
111+ let function_hl_group = s: HLExists (" EasyFunction" ) ? " EasyFunction" : " Conditional"
112+ let snippet_hl_group = s: HLExists (" EasySnippet" ) ? " EasySnippet" : " Number"
113+ let tabnine_hl_group = s: HLExists (" EasyTabNine" ) ? " EasyTabNine" : " Character"
114+ let pmenu_hl_group = s: HLExists (" EasyPmenu" ) ? " EasyPmenu" : " Pmenu"
115+ let keyword_hl_group = s: HLExists (" EasyKeyword" ) ? " EasyKeyword" : " Define"
116+ let module_hl_group = s: HLExists (" EasyModule" ) ? " EasyModule" : " Function"
114117 let pmenu_cursor_has_reverse = s: HasReverseHighlight (" PmenuSel" )
115118 if s: HLExists (" EasyFuzzyMatch" )
116119 let fuzzymatch_bold_str = s: HasBold (" EasyFuzzyMatch" ) ? " gui=bold" : " "
@@ -146,6 +149,7 @@ function! s:hl()
146149 \ ' syntax region CustomSnippet matchgroup=Conceal start=/∫\([^∫]∫\)\@=/ matchgroup=Conceal end=/\(∫[^∫]\)\@<=∫/ concealends oneline' ,
147150 \ ' syntax region CustomTabNine matchgroup=Conceal start=/@\([^@]@\)\@=/ matchgroup=Conceal end=/\(@[^@]\)\@<=@/ concealends oneline' ,
148151 \ ' syntax region CustomKeyword matchgroup=Conceal start=/♧\([^♧]♧\)\@=/ matchgroup=Conceal end=/\(♧[^♧]\)\@<=♧/ concealends oneline' ,
152+ \ ' syntax region CustomModule matchgroup=Conceal start=/♤\([^♤]♤\)\@=/ matchgroup=Conceal end=/\(♤[^♤]\)\@<=♤/ concealends oneline' ,
149153 \ ' syntax region CustomNormal matchgroup=Conceal start=/Φ\([^Φ]Φ\)\@=/ matchgroup=Conceal end=/\(Φ[^Φ]\)\@<=Φ/ concealends oneline' ,
150154 \ " hi CustomFuzzyMatch " . dev . " fg=" . fuzzymatch_fg . " " . fuzzymatch_bold_str,
151155 \ " hi CustomPmenuSel " . dev . " fg=" . pmenu_cursor_hl_group_fg . " " . dev . " bg=" . pmenu_cursor_hl_group_bg,
@@ -156,6 +160,7 @@ function! s:hl()
156160 \ " hi link CustomTabNine " . tabnine_hl_group,
157161 \ " hi link CustomNormal " . pmenu_hl_group,
158162 \ " hi link CustomKeyword " . keyword_hl_group,
163+ \ " hi link CustomModule " . module_hl_group,
159164 \ " hi link Error Pmenu" ,
160165 \ ]
161166 " \ "hi Search guibg=NONE guifg=NONE ctermbg=NONE ctermfg=NONE",
@@ -349,7 +354,7 @@ function! easycomplete#pum#PumGetPos()
349354 \ " width" : w - 1 ,
350355 \ " scrollbar" : scrollbar ,
351356 \ " size" : item_size
352- \}
357+ \ }
353358endfunction
354359
355360function ! easycomplete#pum#CompleteChangedEvnet ()
@@ -1091,6 +1096,7 @@ function! s:MaxLength(lines)
10911096 let remove_style_wrapper = substitute (remove_style_wrapper, " \\ s@\[ ^@\] @\\ s" , " x " , " g" )
10921097 let remove_style_wrapper = substitute (remove_style_wrapper, " \\ sΦ\[ ^Φ\] Φ\\ s" , " x " , " g" )
10931098 let remove_style_wrapper = substitute (remove_style_wrapper, " \\ s♧\[ ^♧\] ♧\\ s" , " x " , " g" )
1099+ let remove_style_wrapper = substitute (remove_style_wrapper, " \\ s♤\[ ^♤\] ♤\\ s" , " x " , " g" )
10941100 let curr_length = strdisplaywidth (substitute (remove_style_wrapper, " \[ §|‰]" , " " , " g" ))
10951101 if curr_length > max_length
10961102 let max_length = curr_length
@@ -1108,27 +1114,31 @@ function! s:MapFunction(key, val)
11081114 let kind_char = " |"
11091115 if g: easycomplete_nerd_font
11101116 let kind_o = get (a: val , " kind" , " " )
1111- if kind_o == # g: easycomplete_lsp_type_font [" function" ] ||
1117+ if kind_o == # g: easycomplete_lsp_type_font [" function" ] ||
11121118 \ kind_o == # g: easycomplete_lsp_type_font [" constant" ] ||
11131119 \ kind_o == # g: easycomplete_lsp_type_font [" struct" ]
11141120 " 颜色1
11151121 let kind_char = " %"
1116- elseif kind_o == # g: easycomplete_menu_skin [" snip" ][" kind" ] ||
1122+ elseif kind_o == # g: easycomplete_menu_skin [" snip" ][" kind" ] ||
11171123 \ kind_o == # g: easycomplete_lsp_type_font [" snippet" ]
11181124 " 颜色2
11191125 let kind_char = " ∫"
11201126 elseif kind_o == # g: easycomplete_menu_skin [" tabnine" ][" kind" ]
11211127 " 颜色3
11221128 let kind_char = " @"
1123- elseif kind_o == # g: easycomplete_menu_skin [" buf" ][" kind" ] ||
1129+ elseif kind_o == # g: easycomplete_menu_skin [" buf" ][" kind" ] ||
11241130 \ kind_o == # g: easycomplete_menu_skin [" dict" ][" kind" ] ||
11251131 \ kind_o == # g: easycomplete_lsp_type_font [" text" ]
11261132 " 颜色4,标准色
11271133 let kind_char = " Φ"
1128- elseif kind_o == # g: easycomplete_lsp_type_font [" keyword" ] ||
1134+ elseif kind_o == # g: easycomplete_lsp_type_font [" keyword" ] ||
11291135 \ kind_o == # g: easycomplete_lsp_type_font [" class" ]
11301136 " 颜色 5
11311137 let kind_char = " ♧"
1138+ elseif kind_o == # g: easycomplete_lsp_type_font [" module" ] ||
1139+ \ kind_o == # g: easycomplete_lsp_type_font [" method" ]
1140+ " 颜色 6
1141+ let kind_char = " ♤"
11321142 endif
11331143 endif
11341144 let format_object = {
0 commit comments