Allow both <tab>
and <enter>
for completion selection
This commit is contained in:
parent
4ca87c09b9
commit
83b0399253
1 changed files with 14 additions and 12 deletions
|
@ -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" },
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue