chore(nvim): use tab, s-tab to cmp
parent
ec2e365b78
commit
e22234acde
|
@ -191,7 +191,27 @@ require("lazy").setup({
|
|||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<CR>"] = cmp.mapping.confirm(),
|
||||
["<CR>"] = function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.confirm()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
["<Tab>"] = function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
["<S-Tab>"] = function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
|
|
Loading…
Reference in New Issue