Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completion without nvim-cmp? #180

Open
heygarrett opened this issue Dec 15, 2023 · 7 comments
Open

Completion without nvim-cmp? #180

heygarrett opened this issue Dec 15, 2023 · 7 comments

Comments

@heygarrett
Copy link

I use the built-in omnicompletion. Is there way to use Cody's completion without nvim-cmp, a la copilot.vim?

@tjdevries
Copy link
Collaborator

I don't think copilot.vim uses omnicomplete, right? It has it's own completion that it uses (otherwise I don't think it's possible to do multi-line completions, or at least not very easily).

I could provide a separate function that you could manually invoke though, if that works for you?

@heygarrett
Copy link
Author

heygarrett commented Jan 5, 2024

That would be great!

Sorry, I didn't mean to imply that it should use omnicompletion, only that copilot.vim doesn't rely on nvim-cmp (to my knowledge).

@tjdevries
Copy link
Collaborator

Yes, copilot.vim uses something else.

So basically just something you could bind to a key to do something like

vim.keymap.set("i", "<c-space>", require"sg.complete".complete)
vim.keymap.set("i", "<tab>", require"sg.complete".accept)

What would your expectation be for what shows up next? Do you want it to be like it puts in some virtual text of what would get inserted and then you press <tab> to accept it? Any other character drops the virtual text?

@heygarrett
Copy link
Author

Yep, spot on; no notes. 👍

@tjdevries
Copy link
Collaborator

OK, excellent 😄 let me see what I can do this week

@tjdevries
Copy link
Collaborator

heh, sorry, took a bit longer than a week (I actually left sourcegraph but am doing some work on sg.nvim for them now as a contractor 😅 ), but I have a PR that might solve at least an initial version of your issue:

#222

Does this work for you? It doesn't add it in automatically. Are you looking for it to autocomplete or via a request?

@heygarrett
Copy link
Author

Oh, I totally forgot about this! I'm so sorry, but I'm no longer using sourcegraph. I feel like an absolute jerk; I should have come back to update the issue. 😞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants