1
0
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:
Alexander Konotop 2022-07-24 11:09:01 +03:00 committed by GitHub
parent e3477f0801
commit 5b5511f2a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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]",