nvim-cmp icon indicating copy to clipboard operation
nvim-cmp copied to clipboard

Feature request: source priority on individual results

Open simonmandlik opened this issue 4 years ago • 2 comments

I'm using a lot of plain text sources, like treesitter, buffer, and rg. Many times this means duplicate results (as results have nonzero intersection), which unnecessarily increase the completion window size. Would it be possible to specify that once a result is available from source A, results with the same name won't show from source B? For sources with different completion behavior, such as snippets, it makes sense to have results with same names, but for plaintext completions like I've shown above it makes a lot of sense in my opinion.

AFAIK, it is possible to specify priority of sources with group_index, so that some sources are shown only if other sources don't return any results.

simonmandlik avatar Mar 31 '22 11:03 simonmandlik

Must be a great feature.

tan-wei avatar Aug 22 '23 04:08 tan-wei

Revisiting this after more than a year of nvim-cmp usage, I still feel that a more fine-grained control of result filtering and autocompletion behavior would be very welcome.

Also sources[n].keyword_pattern and sources[n].trigger_characters doc entries seems almost the same and I didn't understand the difference.

simonmandlik avatar Sep 03 '23 17:09 simonmandlik