diff --git a/lua/cmp/config/mapping.lua b/lua/cmp/config/mapping.lua index 182143c..0367d98 100644 --- a/lua/cmp/config/mapping.lua +++ b/lua/cmp/config/mapping.lua @@ -63,7 +63,27 @@ mapping.preset.cmdline = function(override) cmp.complete() end end - } + }, + [''] = { + c = function(fallback) + local cmp = require('cmp') + if cmp.visible() then + cmp.select_next_item() + else + fallback() + end + end + }, + [''] = { + c = function(fallback) + local cmp = require('cmp') + if cmp.visible() then + cmp.select_prev_item() + else + fallback() + end + end + }, }) end diff --git a/plugin/cmp.lua b/plugin/cmp.lua index 6c0809f..27599fa 100644 --- a/plugin/cmp.lua +++ b/plugin/cmp.lua @@ -29,7 +29,7 @@ misc.set(_G, { 'cmp', 'plugin', 'cmdline', 'enter' }, function() if config.is_native_menu() then return end - if vim.fn.expand('')~= '=' then + if vim.fn.expand('') ~= '=' then vim.schedule(function() if api.is_cmdline_mode() then vim.cmd [[