Skip to content

Help With Completion #50

Answered by mrcjkb
kyp0717 asked this question in Q&A
Nov 15, 2024 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Hey 👋

The keymaps defined in completion.lua are chosen to be close to what you get with native Neovim:
<C-n> and <C-p> to navigate and <C-y> (for "yes") to select a completion.

nvim-cmp provides a mapping DSL via its setup function to configure this:

mapping = {
['<C-b>'] = cmp.mapping(function(_)
if cmp.visible() then
cmp.scroll_docs(-4)
else
complete_with_source('buffer')
end
end, { 'i', 'c', 's' }),
['<C-f>'] = cmp.mapping(function(_)
if cmp.visible() then
cmp.scroll_docs(4)
else
complete_with_source('path')
end
end, { 'i', 'c', 's' }…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kyp0717
Comment options

Answer selected by kyp0717
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants