|
|
|
@ -7,15 +7,13 @@ cmp.setup({
|
|
|
|
|
snippet = {
|
|
|
|
|
expand = function(args)
|
|
|
|
|
vim.fn["vsnip#anonymous"](args.body)
|
|
|
|
|
end,
|
|
|
|
|
end
|
|
|
|
|
},
|
|
|
|
|
mapping = {
|
|
|
|
|
['<cr>'] = cmp.mapping.confirm({ select = true }),
|
|
|
|
|
},
|
|
|
|
|
sources = cmp.config.sources({
|
|
|
|
|
{ name = 'nvim_lsp' },
|
|
|
|
|
{ name = 'vsnip' },
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
name = 'buffer',
|
|
|
|
|
option = {
|
|
|
|
|
get_bufnrs = function()
|
|
|
|
@ -23,19 +21,21 @@ cmp.setup({
|
|
|
|
|
end
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{ name = 'nvim_lsp' },
|
|
|
|
|
{ name = 'path' },
|
|
|
|
|
{ name = 'tmux', option = { all_panes = true } }, -- TODO 'true' makes things sloppy
|
|
|
|
|
{ name = 'vsnip' },
|
|
|
|
|
{ name = 'tmux', option = { all_panes = true } },
|
|
|
|
|
{ name = 'calc' },
|
|
|
|
|
}),
|
|
|
|
|
formatting = {
|
|
|
|
|
format = function(entry, vim_item)
|
|
|
|
|
vim_item.menu = ({
|
|
|
|
|
buffer = "[Buffer]",
|
|
|
|
|
calc = "[Calc]",
|
|
|
|
|
nvim_lsp = "[LSP]",
|
|
|
|
|
path = "[Path]",
|
|
|
|
|
tmux = "[tmux]",
|
|
|
|
|
vsnip = "[Snippet]",
|
|
|
|
|
tmux = "[tmux]",
|
|
|
|
|
calc = "[Calc]",
|
|
|
|
|
})[entry.source.name]
|
|
|
|
|
return vim_item
|
|
|
|
|
end
|
|
|
|
|