Daryl Ronningen
69181599a5
Makes all the plugins lazyload, remove plugins with duplicate uses and just general nit picks and improvements Reviewed-on: Relms/neovim-config#1
55 lines
1.3 KiB
Lua
55 lines
1.3 KiB
Lua
local cmp = require("cmp")
|
|
local lspkind = require("lspkind")
|
|
|
|
cmp.setup({
|
|
snippet = {
|
|
expand = function(args)
|
|
vim.fn["vsnip#anonymous"](args.body)
|
|
end,
|
|
},
|
|
completion = { completeopt = "menu,menuone,noinsert", keyword_length = 1 },
|
|
sources = {
|
|
{ name = "nvim_lsp" },
|
|
{ name = "nvim_lua" },
|
|
{ name = "vsnip" },
|
|
{ name = "buffer" },
|
|
{ name = "path" },
|
|
},
|
|
confirm_opts = {
|
|
behavior = cmp.ConfirmBehavior.Replace,
|
|
select = false,
|
|
},
|
|
window = {
|
|
documentation = {
|
|
border = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" },
|
|
},
|
|
},
|
|
experimental = {
|
|
ghost_text = true,
|
|
native_menu = false,
|
|
},
|
|
formatting = {
|
|
fields = { "abbr", "kind", "menu" },
|
|
format = lspkind.cmp_format({
|
|
mode = "symbol_text",
|
|
maxwidth = 50,
|
|
before = function(entry, vim_item)
|
|
vim_item.menu = ({
|
|
nvim_lsp = "[LSP]",
|
|
nvim_lua = "[NVIM_LUA]",
|
|
vsnip = "[SNIPPET]",
|
|
buffer = "[BUFFER]",
|
|
path = "[PATH]",
|
|
})[entry.source.name]
|
|
return vim_item
|
|
end,
|
|
}),
|
|
},
|
|
mapping = cmp.mapping.preset.insert({
|
|
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
|
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
|
["<C-Space>"] = cmp.mapping.complete(),
|
|
["<C-e>"] = cmp.mapping.abort(),
|
|
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
|
}),
|
|
})
|