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

How to generate a solution word by word? #221

Open
Informativus opened this issue Sep 21, 2024 · 3 comments
Open

How to generate a solution word by word? #221

Informativus opened this issue Sep 21, 2024 · 3 comments

Comments

@Informativus
Copy link

Informativus commented Sep 21, 2024

Hello, I would like to know how I can configure code completion to generate not the entire suggested solution at once, but word by word, like it’s implemented in Copilot. For example, if the suggested solution is throw new Error("This page does not exist"), after pressing Ctrl-W, I want only one word (e.g., throw) to be inserted at a time, and then after each subsequent press of Ctrl-W, the next word in the suggestion is inserted. How can this be implemented?

@aliaksandr-trush
Copy link
Contributor

I guess you need to take a look into nvim-cmp plugin configuration.
Codeium.nvim just providing completion to it, but nvim-cmp plugin decided what and how it should be inserted into buffer.

@ic-768
Copy link

ic-768 commented Sep 26, 2024

@Informativus
This functionality exists in the vim plugin , which works perfectly fine in neovim too.

Honestly I don't know why both versions are maintained or why the vim alternative is so much more complete.
For example, this is a simplified excerpt from my config, which maps the word-by-word completion to c-w:

local M = {
	"Exafunction/codeium.vim",
	branch = "main",
	dependencies = {
		"nvim-lua/plenary.nvim",
	},
}

M.config = function()
	vim.keymap.set("i", "<C-w>", function()
		return vim.fn["codeium#AcceptNextWord"]()
	end, { expr = true, silent = true })
end

return M

@Informativus
Copy link
Author

Oh, thanks, but in this case, as i undestand it, the hint disappears for a while? In copilot this implemented easier, there the hint does not disappear

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

No branches or pull requests

3 participants