Improve cmdline preset

This commit is contained in:
hrsh7th
2022-04-14 01:17:28 +09:00
parent 93cf84f7de
commit f4b3dda782
2 changed files with 22 additions and 2 deletions

View File

@@ -63,7 +63,27 @@ mapping.preset.cmdline = function(override)
cmp.complete()
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