roxma / nvim-completion-manager

:warning: PLEASE USE https://github.com/ncm2/ncm2 INSTEAD
MIT License
917 stars 49 forks source link

vim-devicons support #185

Open xerron opened 6 years ago

xerron commented 6 years ago

https://github.com/ryanoasis/vim-devicons https://github.com/ryanoasis/nerd-fonts

seleccion_008

How can I implement these icons in the popup ?, can it? Please give me some advice.

MaiLunJiye commented 6 years ago

i have a ulgry solution:

--- a/autoload/cm.vim
+++ b/autoload/cm.vim
@@ -112,6 +112,10 @@ endfunc

 func! cm#register_source(info)

+    if exists('*WebDevIconsGetFileTypeSymbol')  " support for vim-devicons
+        let a:info['abbreviation'] = get(g:deviconsDict,a:info['abbreviation'],a:info['abbreviation'])
+    endif
+
     let l:name = a:info['name']

     " if registered before, ignore this call

and then add this to your init.vim

let g:deviconsDict = { "Snip":"",
                        \ "path":"",
                        \ "Tag":"" 
                        \ }

But it only support the source that set abbreviation. As you can see, it is static.


i think we cant add kind to the return of completefunc

the completefunc of ncm is

func! cm#_core_complete(context, startcol, matches, not_changed, snippets)
xerron commented 6 years ago

I think it would be very good to have this feature. Hoping that it is not a very big hit in performance.

I have not even started working on it yet. But I hope to achieve it.

MaiLunJiye commented 6 years ago

I have not even started working on it yet. But I hope to achieve it.

i have, and need some beautiful nerd fonts . would you might give me some advices?

Fork : https://github.com/MaiLunJiye/nvim-completion-manager

xerron commented 6 years ago

@MaiLunJiye screenshoots please.

MaiLunJiye commented 6 years ago

screenshot_20180224_130120

i will release it if it support all builtin sources

btw, i need some beautiful nerd font as the icons of class, value, function ....

MaiLunJiye commented 6 years ago

frist version release

Fork: https://github.com/MaiLunJiye/nvim-completion-manager

issues is wellcome