Allow both <tab> and <enter> for completion selection

This commit is contained in:
Erica Marigold 2025-02-05 11:18:59 +00:00
parent 4ca87c09b9
commit 83b0399253
Signed by: DevComp
SSH key fingerprint: SHA256:jD3oMT4WL3WHPJQbrjC3l5feNCnkv7ndW8nYaHX5wFw

View file

@ -1,3 +1,15 @@
local blinkAcceptKeybind = {
function(cmp)
if cmp.snippet_active() then
return cmp.accept()
else
return cmp.select_and_accept()
end
end,
'snippet_forward',
'fallback'
}
return { return {
{ {
"williamboman/mason.nvim", "williamboman/mason.nvim",
@ -58,18 +70,8 @@ return {
enabled = true, enabled = true,
}, },
keymap = { keymap = {
-- ["<enter>"] = { "select_and_accept" }, ["<enter>"] = blinkAcceptKeybind,
["<tab>"] = { ["<tab>"] = blinkAcceptKeybind,
function(cmp)
if cmp.snippet_active() then
return cmp.accept()
else
return cmp.select_and_accept()
end
end,
'snippet_forward',
'fallback'
},
["<c-enter>"] = { "show", "show_documentation", "hide_documentation" }, ["<c-enter>"] = { "show", "show_documentation", "hide_documentation" },
} }
}, },