-
Feature DescriptionI've been trying to configure Here's example config: {
'saghen/blink.cmp',
version = 'v0.8.2',
opts = {
keymap = {
preset = 'default',
['<CR>'] = { 'accept', 'fallback' },
['<Tab>'] = {
function(cmp)
if (vim.api.nvim_get_mode().mode == 'c') then
cmp.show()
else
-- Fallback ?
end
end,
},
},
completion = {
menu = { auto_show = function(ctx) return ctx.mode ~= 'cmdline' end }
},
},
opts_extend = { "sources.default" }
} Without conditional fallback, only two options are available:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Not sure I'm understanding correctly, but you can run the fallback by returning a non truthy value from the previous command, see: https://cmp.saghen.dev/configuration/keymap.html#example ['<C-n>'] = {
function(cmp)
if (vim.api.nvim_get_mode().mode == 'c') then
return cmp.show() -- returns true if it shows, otherwise nil
end
-- runs next command because we return nil
end,
"fallback"
} |
Beta Was this translation helpful? Give feedback.
Not sure I'm understanding correctly, but you can run the fallback by returning a non truthy value from the previous command, see: https://cmp.saghen.dev/configuration/keymap.html#example