diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 359225b..e159a17 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -36,32 +36,18 @@ if vim.g.useblinkcmp then { 'saghen/blink.cmp', opts = { - keymap = { - preset = 'super-tab', - [''] = { 'show', 'show_documentation', 'hide_documentation' }, - [''] = { 'hide', 'fallback' }, - - [''] = { - LazyVim.cmp.map({ 'select_and_accept', 'ai_accept' }), - 'fallback', + enabled = function() + return not vim.tbl_contains({ 'minifiles' }, vim.bo.filetype) + and vim.bo.buftype ~= 'prompt' + and vim.b.completion ~= false + end, + completion = { + menu = { + auto_show = function(ctx) + return ctx.mode ~= 'cmdline' + or not vim.tbl_contains({ '/', '?' }, vim.fn.getcmdtype()) + end, }, - - [''] = { - 'snippet_forward', - 'fallback', - }, - [''] = { 'snippet_backward', 'fallback' }, - - [''] = { 'select_prev', 'fallback' }, - [''] = { 'select_next', 'fallback' }, - [''] = { 'select_prev', 'fallback' }, - [''] = { 'select_next', 'fallback' }, - - [''] = { 'scroll_documentation_up', 'fallback' }, - [''] = { 'scroll_documentation_down', 'fallback' }, - }, - windows = { - selection = 'manual', }, }, },