mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 07:10:06 +08:00
fix(nvim-cmp): fix broken hotkeys and add tab,s-tab
This commit is contained in:
parent
e3477f0801
commit
5b5511f2a5
@ -3,7 +3,7 @@ lua <<EOF
|
||||
local cmp = require'cmp'
|
||||
|
||||
cmp.setup({
|
||||
mapping = {
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-d>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }),
|
||||
['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }),
|
||||
['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),
|
||||
@ -13,7 +13,21 @@ lua <<EOF
|
||||
c = cmp.mapping.close(),
|
||||
}),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||
},
|
||||
['<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,
|
||||
}),
|
||||
formatting = {
|
||||
format = require("lspkind").cmp_format({with_text = true, menu = ({
|
||||
buffer = "[Buffer]",
|
||||
|
Loading…
Reference in New Issue
Block a user