feat(nvim): add new mappings for selecting next and prev item in the cmp cmdline
This commit is contained in:
1 parent
e3d65eba91
commit
3dd73f914c
4 files changed
+39
-16
No files matched your search
@@ -57,7 +57,26 @@ return {
|
||||
}
|
||||
|
||||
cmp.setup.cmdline({ "/", "?" }, {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
mapping = cmp.mapping.preset.cmdline({
|
||||
["<C-j>"] = {
|
||||
c = function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
},
|
||||
["<C-k>"] = {
|
||||
c = function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
},
|
||||
}),
|
||||
sources = {
|
||||
{ name = "buffer" },
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user