hrsh7th / nvim-cmp

A completion plugin for neovim coded in Lua.
MIT License
7.45k stars 370 forks source link

How to change the completion sources based on line contents #1889

Open snoblenet opened 2 months ago

snoblenet commented 2 months ago

When a line matches one of these two patterns...

...I'd like to do one of these two things:

Is this possible? I could not find any clues in the docs, but I might have missed something.

Thanks :-)

xzbdmw commented 2 months ago

Yeah, writing a custom comparator and based on your line content to change weight. (it runs on every keypress and may not worth it)