diff --git a/README.md b/README.md index 43768100..5f6471fe 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,6 @@ Global configurations | `g:easycomplete_diagnostics_enable` | 1 | Enable diagnostics | | `g:easycomplete_signature_enable` | 1 | Enable signature | | `g:easycomplete_diagnostics_hover` | 1 | Gives a diagnostic prompt when the cursor holds | -| `g:easycomplete_scheme` | `""` | Popup menu colorscheme | Typing `:h easycomplete` for help. @@ -264,8 +263,6 @@ Disable TabNine inline suggestion: `let g:easycomplete_tabnine_suggestion = 0`. ## Beautify the vim completion menu -There are four build-in popup menu themes in cterm: `blue`,`light`,`rider` and `sharp`(for iterm). (`let g:easycomplete_scheme="sharp"`). - If you just want to use default nerdfonts configuration, you can simplily config `g:easycomplete_nerd_font = 1` If you want to customize the kind icon, you can modify the configuration with installed. [Examples](beautify-menu-items.md). diff --git a/autoload/easycomplete.vim b/autoload/easycomplete.vim index 8ef78359..ee86f2aa 100644 --- a/autoload/easycomplete.vim +++ b/autoload/easycomplete.vim @@ -100,7 +100,6 @@ function! easycomplete#_enable() call s:ConstructorCalling() doautocmd User easycomplete_after_constructor call s:SetupCompleteCache() - call easycomplete#ui#SetScheme() " lsp 服务初始化必须要放在按键绑定之后 if !easycomplete#sources#deno#IsTSOrJSFiletype() || easycomplete#sources#deno#IsDenoProject() call easycomplete#lsp#enable() diff --git a/autoload/easycomplete/popup.vim b/autoload/easycomplete/popup.vim index 844dca7e..6ff4f459 100644 --- a/autoload/easycomplete/popup.vim +++ b/autoload/easycomplete/popup.vim @@ -505,6 +505,7 @@ function! s:NVimShow(opt, windowtype, float_type) if a:windowtype == "float" && a:float_type == "signature" if has("nvim-0.9.0") call setbufvar(winbufnr(winid), '&filetype', 'markdown') + call setbufvar(winbufnr(winid), '&conceallevel', 3) endif call easycomplete#ui#ApplyMarkdownSyntax(winid) endif diff --git a/autoload/easycomplete/ui.vim b/autoload/easycomplete/ui.vim index 68ea05bd..091cb02a 100644 --- a/autoload/easycomplete/ui.vim +++ b/autoload/easycomplete/ui.vim @@ -1,43 +1,3 @@ -" Cterm 下默认四种菜单样式 -" 支持四种 dark, light, rider, sharp -" Set Scheme {{{ -function! easycomplete#ui#SetScheme() - if !exists("g:easycomplete_scheme") - return - endif - " hi Pmenu ctermfg=111 ctermbg=235 - " hi PmenuSel ctermfg=255 ctermbg=238 - " hi PmenuSbar ctermbg=235 - " hi PmenuThumb ctermbg=234 - let l:scheme_config = { - \ 'light': [[234, 251], [255, 26], [-1, 251], [-1, 247]], - \ 'rider': [[251, 237], [231, 25], [-1, 237], [-1, 239]], - \ 'sharp': [[255, 237], [235, 255], [-1, 245], [-1, 255]], - \ 'blue': [['White', 'DarkBlue'], ['Red', 'White'], [-1, 245],[-1, 255]], - \ } - if has_key(l:scheme_config, g:easycomplete_scheme) && g:env_is_iterm == v:false - let sch = l:scheme_config[g:easycomplete_scheme] - let hiPmenu = ['hi','Pmenu', 'ctermfg='.sch[0][0], 'ctermbg='.sch[0][1]] - let hiPmenuSel = ['hi','PmenuSel', 'ctermfg='.sch[1][0], 'ctermbg='.sch[1][1]] - let hiPmenuSbar = ['hi','PmenuSbar', '', 'ctermbg='.sch[2][1]] - let hiPmenuThumb = ['hi','PmenuThumb', '', 'ctermbg='.sch[3][1]] - execute join(hiPmenu, ' ') - execute join(hiPmenuSel, ' ') - execute join(hiPmenuSbar, ' ') - execute join(hiPmenuThumb, ' ') - endif - - if g:env_is_iterm == v:true - if g:easycomplete_scheme == 'sharp' - hi! PMenu guifg=#d4d4d4 guibg=#252526 gui=NONE - hi! PmenuSel guifg=#ffffff guibg=#04395e gui=NONE - hi! PmenuSbar guibg=#252526 - hi! PmenuThumb guibg=#474747 - endif - - endif -endfunction " }}} - " markdown syntax {{{ function! easycomplete#ui#ApplyMarkdownSyntax(winid) " 默认 Popup 的 Markdown 文档都基于 help syntax @@ -47,7 +7,8 @@ function! easycomplete#ui#ApplyMarkdownSyntax(winid) if has("nvim") if has("nvim-0.9.0") let exec_cmd = [ - \ "hi markdownCode cterm=underline gui=underline", + \ 'syntax region markdownRule matchgroup=Conceal start=/\%(``\)\@!`/ matchgroup=Conceal end=/\%(``\)\@!`/ concealends', + \ "hi markdownRule cterm=underline gui=underline", \ ] else let exec_cmd = [