tzachar / cmp-tabnine

TabNine plugin for hrsh7th/nvim-cmp
MIT License
286 stars 27 forks source link

Tabnine sorting #86

Closed gmnz closed 1 year ago

gmnz commented 1 year ago

Hi,

If I understand this part right https://github.com/tzachar/cmp-tabnine#sorting tabnine can make the order of its own suggestions smarter. How do I use this while still keeping the items from lsp on the top of the cmp suggestions, please? I've read the :help nvim-cmp and tried a few variantions of priority configs but tabnine items are always on the top if I use this "tabnine sorting".

tzachar commented 1 year ago

You can move the tabnine sorting function to be the last one, that way it will get the lowest priority. Other than that, you can implement your own sorting function to achieve whichever logic works for you.

gmnz commented 1 year ago

Thanks, that worked! Didn't know the order of the sorting functions matters too. I was changing the order of sources and their priority and the priority_weight of sorting functions...