roxma / nvim-completion-manager

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

todo: fuzzy matching #8

Open roxma opened 7 years ago

prabirshrestha commented 7 years ago

+1

Also should be able to customize the match function. Also could be async so that I could use other languages like golang for better fuzzy matching.

For asyncomplete I'm internally using https://github.com/tpope/vim-haystack filter function but haven't pushed it to public yet.

roxma commented 7 years ago

I have a simple implementation.

But the flikering feels terrible for remote terminal user, due to nvim's builtin popup menu filtering.

output

roxma commented 7 years ago

I'm planning on an attempt to use the completefunc to tune the NCM core implementation to reduce the flickering. I'm not sure it's gonna work, though.

roxma commented 7 years ago

The flickering could be fixed with completefunc implementation.

But I feel cursor flickering at the right bottom corner of the popup menu, though, it cannot be seen in this screencast. I don't know how to fix this.

output

roxma commented 7 years ago

Update screencast for cursor flickering

animation

roxma commented 7 years ago

Related issue https://github.com/neovim/neovim/issues/6115

iamcco commented 7 years ago

nice work 👍

roxma commented 7 years ago

Fuzzy matching could be enabled with this setting:

let g:cm_matcher = {'module': 'cm_matchers.fuzzy_matcher', 'case': 'smartcase'}

I'm keeping this issue open until the cursor flickering issue is fixed.

casprwang commented 7 years ago

great work!

roxma commented 7 years ago

There's a more intuitive version of fuzzy matching brought by @sassanh , on https://github.com/roxma/nvim-completion-manager/pull/80

let g:cm_matcher = {'module': 'cm_matchers.abbrev_matcher'}

EDIT:

This module requires the ag binary from the_silver_searcher

meain commented 7 years ago
let g:cm_matcher = {'module': 'cm_matchers.abbrev_matcher'}

does not work for me. I have ag in the $PATH.

sassanh commented 7 years ago

@meain can you check the logs and see what's going wrong? https://github.com/roxma/nvim-completion-manager/wiki/Trouble-shooting

meain commented 7 years ago

@sassanh Any idea as to what I should be looking for. Also which log file should I be checking?

cat nvim_log_py3_cm_* | grep ERROR

returned nothing

sassanh commented 7 years ago

@meain consider using -i for your grep to make it incasesensitive.

meain commented 7 years ago

@sassanh Still nothing.

sassanh commented 7 years ago

@meain Is ncm working and fuzzy find not working or auto completion doesn't work at all?

meain commented 7 years ago

Just fuzzy not working

sassanh commented 7 years ago

That's strange. If fuzzy raises an error then ncm shouldn't work at all. How are you testing? What you type, what you expect to receive and what you actually get from ncm?

meain commented 7 years ago

@sassanh Sorry, my bad. I was cheching fuzzy matching after setting abbrv matching. It works.