Skip to content

Commit

Permalink
fix(cmp): provide better suggestions based on sources priorities & so…
Browse files Browse the repository at this point in the history
…rting
  • Loading branch information
ecosse3 committed Apr 14, 2022
1 parent 216ffc0 commit 10b55a7
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions lua/plugins/cmp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -104,23 +104,23 @@ cmp.setup {

-- You should specify your *installed* sources.
sources = {
{ name = 'nvim_lsp' },
{ name = 'npm' },
{ name = 'cmp_tabnine', max_item_count = 3 },
{ name = 'buffer', keyword_length = 5 },
{ name = 'path' },
{ name = 'luasnip' },
{ name = 'calc' },
{ name = 'nvim_lua' },
{ name = 'npm', priority = 9 },
{ name = 'nvim_lsp', priority = 8 },
{ name = 'cmp_tabnine', priority = 8, max_item_count = 3 },
{ name = 'luasnip', priority = 7 },
{ name = 'buffer', priority = 7, keyword_length = 5 },
{ name = 'nvim_lua', priority = 5 },
{ name = 'path',priority = 4 },
{ name = 'calc', priority = 3 },
},

sorting = {
priority_weight = 1.0,
comparators = {
cmp.config.compare.locality,
cmp.config.compare.recently_used,
cmp.config.compare.offset,
cmp.config.compare.score,
cmp.config.compare.sort_text,
cmp.config.compare.length,
cmp.config.compare.offset,
cmp.config.compare.order,
},
},
Expand Down

0 comments on commit 10b55a7

Please sign in to comment.