Improve cmdline preset
This commit is contained in:
@@ -63,7 +63,27 @@ mapping.preset.cmdline = function(override)
|
|||||||
cmp.complete()
|
cmp.complete()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}
|
},
|
||||||
|
['<C-n>'] = {
|
||||||
|
c = function(fallback)
|
||||||
|
local cmp = require('cmp')
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_next_item()
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
},
|
||||||
|
['<C-p>'] = {
|
||||||
|
c = function(fallback)
|
||||||
|
local cmp = require('cmp')
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_prev_item()
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
},
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ misc.set(_G, { 'cmp', 'plugin', 'cmdline', 'enter' }, function()
|
|||||||
if config.is_native_menu() then
|
if config.is_native_menu() then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if vim.fn.expand('<afile>')~= '=' then
|
if vim.fn.expand('<afile>') ~= '=' then
|
||||||
vim.schedule(function()
|
vim.schedule(function()
|
||||||
if api.is_cmdline_mode() then
|
if api.is_cmdline_mode() then
|
||||||
vim.cmd [[
|
vim.cmd [[
|
||||||
|
|||||||
Reference in New Issue
Block a user