Help with cmp completion + context input #1060
paulodiovani
started this conversation in
General
Replies: 1 comment
-
Moved this to discussions as its not actual issue I dont think. But also you probably cant use c-space if nvim-cmp is using c-space as well, as they will conflict. you can make custom mapping and disable the .complete from copilot chat, and then call chat.trigger_completion which should also trigger then input after : , but you need to also include nvim-cmp logic inside if needed and also check if previous character is : or not etc |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Since v3 does not include the [cmp integration])https://github.com/CopilotC-Nvim/CopilotChat.nvim/blob/v2.16.0/lua/CopilotChat/integrations/cmp.lua anymore, I created my own complete source as below, but I also wanted to use the same
<C-Space>
mapping to autocomplete or prompt#context
options.e.g.
Setting
<C-Space>
in the mappings does not work, neither does<C-@>
.e.g.
It would be nice to be able to use
cmp
for some of the contexts, such as#buffers:
, but I didn't managed to do that either.CMP Complete source for CopilotChat
Note: this works for current
main
branch, more precisely for commitf84727f
, but will not work for thev3.9.1
or older, because thecomplete_items()
changed from receiving a callback to returning the list of items. If someone intend to copy these and use with a released version, you'll need to update the code. I'm usingmain
because the version with the callback was much slower.Beta Was this translation helpful? Give feedback.
All reactions