-
Notifications
You must be signed in to change notification settings - Fork 0
Replace copilot.vim
with copilot.lua
#65
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
base: main
Are you sure you want to change the base?
Replace copilot.vim
with copilot.lua
#65
Conversation
- This way we can press enter to start writing in a new line without accepting the completion.
sorting = { | ||
priority_weight = 2, | ||
comparators = { | ||
require("copilot_cmp.comparators").prioritize, | ||
|
||
-- Below is the default comparitor list and order for nvim-cmp | ||
cmp.config.compare.offset, | ||
-- cmp.config.compare.scopes, --this is commented in nvim-cmp too | ||
cmp.config.compare.exact, | ||
cmp.config.compare.score, | ||
cmp.config.compare.recently_used, | ||
cmp.config.compare.locality, | ||
cmp.config.compare.kind, | ||
cmp.config.compare.sort_text, | ||
cmp.config.compare.length, | ||
cmp.config.compare.order, | ||
}, | ||
}, | ||
}) | ||
cmp.setup({ | ||
window = { | ||
completion = cmp.config.window.bordered(), | ||
documentation = cmp.config.window.bordered(), | ||
}, | ||
mapping = { | ||
["<CR>"] = vim.schedule_wrap(function(fallback) | ||
if cmp.visible() and has_words_before() then | ||
cmp.select_next_item({ behavior = cmp.SelectBehavior.Select }) | ||
else | ||
fallback() | ||
end | ||
end), | ||
}, | ||
}) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity: what is this for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They come from these configs:
I'm on board with migrating from For start, I'm not able to get copilot suggestions until I start to type, which is not ideal IMO. What's more, it seems that all the suggestions that I get now are one-liners 🤔 Does that happen to you? I will continue using if for a couple more days though to see how I feel, but those are my first impressions |
What?
Replaced the copilot.vim plugin with copilot.lua, which provides tighter integration with the completion engine. Completions are now enabled by default.
Why?
copilot.vim
lacks proper integration with completion engines, making it harder to use alongside tools likenvim-cmp
. Switching tocopilot.lua
resolves this limitation.References
copilot.lua
copilot-cmp configuration guide